fix(service-details): clear volume source when changing type (#4671)

pull/4868/head
Chaim Lev-Ari 4 years ago committed by GitHub
parent c705c04d65
commit 6c8276c65c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,7 +28,7 @@
name="mountType" name="mountType"
class="form-control" class="form-control"
ng-model="mount.Type" ng-model="mount.Type"
ng-change="updateMount(service, mount)" ng-change="onChangeMountType(service, mount)"
ng-disabled="isUpdating" ng-disabled="isUpdating"
disable-authorization="DockerServiceUpdate" disable-authorization="DockerServiceUpdate"
> >

@ -209,6 +209,12 @@ angular.module('portainer.docker').controller('ServiceController', [
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts); updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
} }
}; };
$scope.onChangeMountType = function onChangeMountType(service, mount) {
mount.Source = null;
$scope.updateMount(service, mount);
};
$scope.updateMount = function updateMount(service) { $scope.updateMount = function updateMount(service) {
updateServiceArray(service, 'ServiceMounts', service.ServiceMounts); updateServiceArray(service, 'ServiceMounts', service.ServiceMounts);
}; };

Loading…
Cancel
Save