mirror of https://github.com/portainer/portainer
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 viewpull/4115/head
parent
0cebe6588a
commit
2bc6b2dff7
|
@ -189,7 +189,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
||||||
|
|
||||||
function preparePortBindings(config) {
|
function preparePortBindings(config) {
|
||||||
const bindings = ContainerHelper.preparePortBindings(config.HostConfig.PortBindings);
|
const bindings = ContainerHelper.preparePortBindings(config.HostConfig.PortBindings);
|
||||||
config.ExposedPorts={};
|
config.ExposedPorts = {};
|
||||||
_.forEach(bindings, (_, key) => (config.ExposedPorts[key] = {}));
|
_.forEach(bindings, (_, key) => (config.ExposedPorts[key] = {}));
|
||||||
config.HostConfig.PortBindings = bindings;
|
config.HostConfig.PortBindings = bindings;
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,9 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
||||||
Volume.query(
|
Volume.query(
|
||||||
{},
|
{},
|
||||||
function (d) {
|
function (d) {
|
||||||
$scope.availableVolumes = d.Volumes;
|
$scope.availableVolumes = d.Volumes.sort((vol1, vol2) => {
|
||||||
|
return vol1.Name.localeCompare(vol2.Name);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
function (e) {
|
function (e) {
|
||||||
Notifications.error('Failure', e, 'Unable to retrieve volumes');
|
Notifications.error('Failure', e, 'Unable to retrieve volumes');
|
||||||
|
|
Loading…
Reference in New Issue