mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
Merge branch 'develop' into feat1654-colorize-logs
This commit is contained in:
commit
a7fc7816d1
474 changed files with 15372 additions and 8022 deletions
|
@ -5,7 +5,7 @@ const portPattern = /^([1-9]|[1-5]?[0-9]{2,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655
|
|||
|
||||
function parsePort(port) {
|
||||
if (portPattern.test(port)) {
|
||||
return parseInt(port);
|
||||
return parseInt(port, 10);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
@ -211,14 +211,14 @@ angular.module('portainer.docker').factory('ContainerHelper', [
|
|||
_.forEach(portBindingKeysByHostIp, (portBindingKeys, ip) => {
|
||||
// Sort by host port
|
||||
const sortedPortBindingKeys = _.orderBy(portBindingKeys, (portKey) => {
|
||||
return parseInt(_.split(portKey, '/')[0]);
|
||||
return parseInt(_.split(portKey, '/')[0], 10);
|
||||
});
|
||||
|
||||
let previousHostPort = -1;
|
||||
let previousContainerPort = -1;
|
||||
_.forEach(sortedPortBindingKeys, (portKey) => {
|
||||
const portKeySplit = _.split(portKey, '/');
|
||||
const containerPort = parseInt(portKeySplit[0]);
|
||||
const containerPort = parseInt(portKeySplit[0], 10);
|
||||
const portBinding = portBindings[portKey][0];
|
||||
portBindings[portKey].shift();
|
||||
const hostPort = parsePort(portBinding.HostPort);
|
||||
|
@ -259,6 +259,10 @@ angular.module('portainer.docker').factory('ContainerHelper', [
|
|||
return bindings;
|
||||
};
|
||||
|
||||
helper.getContainerNames = function (containers) {
|
||||
return _.map(_.flatten(_.map(containers, 'Names')), (name) => _.trimStart(name, '/'));
|
||||
};
|
||||
|
||||
return helper;
|
||||
},
|
||||
]);
|
||||
|
|
|
@ -40,6 +40,10 @@ angular.module('portainer.docker').factory('ImageHelper', [
|
|||
if (registry.Registry.Type === RegistryTypes.GITLAB) {
|
||||
const slash = _.startsWith(registry.Image, ':') ? '' : '/';
|
||||
fullImageName = registry.Registry.URL + '/' + registry.Registry.Gitlab.ProjectPath + slash + registry.Image;
|
||||
} else if (registry.Registry.Type === RegistryTypes.QUAY) {
|
||||
const name = registry.Registry.Quay.UseOrganisation ? registry.Registry.Quay.OrganisationName : registry.Registry.Username;
|
||||
const url = registry.Registry.URL ? registry.Registry.URL + '/' : '';
|
||||
fullImageName = url + name + '/' + registry.Image;
|
||||
} else {
|
||||
const url = registry.Registry.URL ? registry.Registry.URL + '/' : '';
|
||||
fullImageName = url + registry.Image;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue