1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00

feat(ui): simplify views for internal usage

This commit is contained in:
Anthony Lapenna 2016-07-06 19:04:45 +12:00
parent d227bdfc75
commit b997b787c4
14 changed files with 161 additions and 343 deletions

View file

@ -24,12 +24,8 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, V
}
};
$scope.resetVolumePath = function(index) {
$scope.formValues.Volumes[index].name = '';
};
$scope.addVolume = function() {
$scope.formValues.Volumes.push({ name: '', containerPath: '', readOnly: false, isPath: false });
$scope.formValues.Volumes.push({ name: '', containerPath: '' });
};
$scope.removeVolume = function(index) {
@ -56,7 +52,12 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, V
var swarm = c.swarm;
Volume.query({}, function (d) {
$scope.availableVolumes = d.Volumes;
var persistedVolumes = d.Volumes.filter(function (volume) {
if (volume.Driver === 'local-persist') {
return volume;
}
});
$scope.availableVolumes = _.uniqBy(persistedVolumes, 'Name');
}, function (e) {
Messages.error("Failure", e.data);
});
@ -69,6 +70,7 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, V
return network;
}
});
$scope.globalNetworkCount = networks.length;
networks.push({Name: "bridge"});
networks.push({Name: "host"});
networks.push({Name: "none"});