1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

feat(services): add a confirmation modal before deleting one or multiple services (#742)

This commit is contained in:
Anthony Lapenna 2017-03-30 11:22:59 +02:00 committed by GitHub
parent f9c1941384
commit a48503d821
2 changed files with 29 additions and 6 deletions

View file

@ -68,7 +68,17 @@ function ($q, $scope, $stateParams, $state, Service, ServiceHelper, Messages, Pa
});
};
$scope.removeAction = function () {
$scope.removeAction = function() {
ModalService.confirmDeletion(
'Do you want to delete the selected service(s)? All the containers associated to the selected service(s) will be removed too.',
function onConfirm(confirmed) {
if(!confirmed) { return; }
removeServices();
}
);
};
function removeServices() {
$('#loadServicesSpinner').show();
var counter = 0;
var complete = function () {
@ -108,7 +118,11 @@ function ($q, $scope, $stateParams, $state, Service, ServiceHelper, Messages, Pa
});
}
});
};
}
// $scope.removeAction = function () {
//
// };
function mapUsersToServices(users) {
angular.forEach($scope.services, function (service) {