feat(docker/container-creation): sort volumes in container creation view (#4078)

* #3635 fix(containers) sort volumes in container creation view

* fix(3635) sort volumes in container creation view
pull/4115/head
DarkAEther 2020-07-27 02:58:33 +05:30 committed by GitHub
parent 0cebe6588a
commit 2bc6b2dff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -189,7 +189,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
function preparePortBindings(config) {
const bindings = ContainerHelper.preparePortBindings(config.HostConfig.PortBindings);
config.ExposedPorts={};
config.ExposedPorts = {};
_.forEach(bindings, (_, key) => (config.ExposedPorts[key] = {}));
config.HostConfig.PortBindings = bindings;
}
@ -612,7 +612,9 @@ angular.module('portainer.docker').controller('CreateContainerController', [
Volume.query(
{},
function (d) {
$scope.availableVolumes = d.Volumes;
$scope.availableVolumes = d.Volumes.sort((vol1, vol2) => {
return vol1.Name.localeCompare(vol2.Name);
});
},
function (e) {
Notifications.error('Failure', e, 'Unable to retrieve volumes');