1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(templates): add the ability to update the volume configuration (#590)

This commit is contained in:
Anthony Lapenna 2017-02-13 18:16:14 +13:00 committed by GitHub
parent c5552d1b8e
commit 781dad3e17
7 changed files with 188 additions and 47 deletions

View file

@ -66,5 +66,32 @@ angular.module('portainer.helpers')
return env;
};
helper.createVolumeBindings = function(volumes, generatedVolumesPile) {
volumes.forEach(function (volume) {
if (volume.containerPath) {
var binding;
if (volume.type === 'auto') {
binding = generatedVolumesPile.pop().Name + ':' + volume.containerPath;
} else if (volume.type !== 'auto' && volume.name) {
binding = volume.name + ':' + volume.containerPath;
}
if (volume.readOnly) {
binding += ':ro';
}
volume.binding = binding;
}
});
};
helper.determineRequiredGeneratedVolumeCount = function(volumes) {
var count = 0;
volumes.forEach(function (volume) {
if (volume.type === 'auto') {
++count;
}
});
return count;
};
return helper;
}]);