mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 18:59:41 +02:00
feat(app/volumes): add confirmation modal before deleting volumes in volumes view and volume view (#4597)
This commit is contained in:
parent
bd98b8956a
commit
58bf76a58f
2 changed files with 35 additions and 26 deletions
|
@ -51,14 +51,18 @@ angular.module('portainer.docker').controller('VolumeController', [
|
|||
};
|
||||
|
||||
$scope.removeVolume = function removeVolume() {
|
||||
VolumeService.remove($scope.volume)
|
||||
.then(function success() {
|
||||
Notifications.success('Volume successfully removed', $transition$.params().id);
|
||||
$state.go('docker.volumes', {});
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove volume');
|
||||
});
|
||||
ModalService.confirmDeletion('Do you want to remove this volume?', (confirmed) => {
|
||||
if (confirmed) {
|
||||
VolumeService.remove($scope.volume)
|
||||
.then(function success() {
|
||||
Notifications.success('Volume successfully removed', $transition$.params().id);
|
||||
$state.go('docker.volumes', {});
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove volume');
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function getVolumeDataFromContainer(container, volumeId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue