|
|
|
@ -157,7 +157,7 @@ function ($scope, $stateParams, $state, $location, $anchorScroll, Service, Servi
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.updateService = function updateService(service) {
|
|
|
|
|
$('#loadServicesSpinner').show();
|
|
|
|
|
$('#loadingViewSpinner').show();
|
|
|
|
|
var config = ServiceHelper.serviceToConfig(service.Model);
|
|
|
|
|
config.Name = service.Name;
|
|
|
|
|
config.Labels = translateServiceLabelsToLabels(service.ServiceLabels);
|
|
|
|
@ -198,11 +198,13 @@ function ($scope, $stateParams, $state, $location, $anchorScroll, Service, Servi
|
|
|
|
|
Window: service.RestartWindow
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
service.Ports.forEach(function (binding) {
|
|
|
|
|
if (binding.PublishedPort === null || binding.PublishedPort === '') {
|
|
|
|
|
delete binding.PublishedPort;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (service.Ports) {
|
|
|
|
|
service.Ports.forEach(function (binding) {
|
|
|
|
|
if (binding.PublishedPort === null || binding.PublishedPort === '') {
|
|
|
|
|
delete binding.PublishedPort;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config.EndpointSpec = {
|
|
|
|
|
Mode: config.EndpointSpec.Mode || 'vip',
|
|
|
|
@ -210,12 +212,12 @@ function ($scope, $stateParams, $state, $location, $anchorScroll, Service, Servi
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Service.update({ id: service.Id, version: service.Version }, config, function (data) {
|
|
|
|
|
$('#loadServicesSpinner').hide();
|
|
|
|
|
$('#loadingViewSpinner').hide();
|
|
|
|
|
Messages.send("Service successfully updated", "Service updated");
|
|
|
|
|
$scope.cancelChanges({});
|
|
|
|
|
fetchServiceDetails();
|
|
|
|
|
}, function (e) {
|
|
|
|
|
$('#loadServicesSpinner').hide();
|
|
|
|
|
$('#loadingViewSpinner').hide();
|
|
|
|
|
Messages.error("Failure", e, "Unable to update service");
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|