feat(service): Add editable service update configuration (#346)

* #304 Add editable service update configuration

* fix unable to use 0 for update-delay

* apply margin top to center help text
This commit is contained in:
Glowbal
2016-12-25 21:31:22 +01:00
committed by Anthony Lapenna
parent 712b4528c0
commit 986171ecfe
5 changed files with 140 additions and 1 deletions
@@ -18,7 +18,10 @@ function ($scope, $state, Service, Volume, Network, ImageHelper, Messages) {
Volumes: [],
Network: '',
ExtraNetworks: [],
Ports: []
Ports: [],
Parallelism: 1,
UpdateDelay: 0,
FailureAction: 'pause'
};
$scope.addPortBinding = function() {
@@ -168,6 +171,14 @@ function ($scope, $state, Service, Volume, Network, ImageHelper, Messages) {
config.Networks = _.uniqWith(networks, _.isEqual);
}
function prepareUpdateConfig(config, input) {
config.UpdateConfig = {
Parallelism: input.Parallelism || 0,
Delay: input.UpdateDelay || 0,
FailureAction: input.FailureAction
};
}
function prepareConfiguration() {
var input = $scope.formValues;
var config = {
@@ -188,6 +199,7 @@ function ($scope, $state, Service, Volume, Network, ImageHelper, Messages) {
prepareLabelsConfig(config, input);
prepareVolumes(config, input);
prepareNetworks(config, input);
prepareUpdateConfig(config, input);
return config;
}