1
0
Fork 0
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:
Ricardo Matsui 2021-04-15 22:38:43 -07:00 committed by GitHub
commit a7fc7816d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
474 changed files with 15372 additions and 8022 deletions

View file

@ -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;
},
]);

View file

@ -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;