mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +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
|
@ -71,16 +71,19 @@ function ($scope, Container, ContainerHelper, Info, Settings, Messages, Config,
|
|||
}
|
||||
else if (action === Container.remove) {
|
||||
action({id: c.Id}, function (d) {
|
||||
var error = errorMsgFilter(d);
|
||||
if (error) {
|
||||
Messages.send("Error", "Unable to remove running container");
|
||||
if (d.message) {
|
||||
Messages.send("Error", d.message);
|
||||
}
|
||||
else {
|
||||
Messages.send("Container " + msg, c.Id);
|
||||
}
|
||||
complete();
|
||||
}, function (e) {
|
||||
Messages.error("Failure", e.data);
|
||||
if (e.data.message) {
|
||||
Messages.error("Failure", e.data.message);
|
||||
} else {
|
||||
Messages.error("Failure", 'Unable to remove container');
|
||||
}
|
||||
complete();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue