mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
feat(container): add a deletion generic handler used for container/network deletion
This commit is contained in:
parent
4b979628b3
commit
fb982ca8f1
4 changed files with 48 additions and 32 deletions
|
@ -121,11 +121,21 @@ function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, Ima
|
|||
$scope.remove = function () {
|
||||
$('#loadingViewSpinner').show();
|
||||
Container.remove({id: $stateParams.id}, function (d) {
|
||||
$state.go('containers', {}, {reload: true});
|
||||
Messages.send("Container removed", $stateParams.id);
|
||||
if (d.message) {
|
||||
$('#loadingViewSpinner').hide();
|
||||
Messages.send("Error", d.message);
|
||||
}
|
||||
else {
|
||||
$state.go('containers', {}, {reload: true});
|
||||
Messages.send("Container removed", $stateParams.id);
|
||||
}
|
||||
}, function (e) {
|
||||
if (e.data.message) {
|
||||
Messages.error("Failure", e.data.message);
|
||||
} else {
|
||||
Messages.error("Failure", 'Unable to remove container');
|
||||
}
|
||||
update();
|
||||
Messages.error("Failure", "Container failed to remove." + e.data);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue