mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
enable remove action for "created" state containers
This commit is contained in:
parent
eb49e51ffb
commit
6d37a4e333
@ -110,9 +110,7 @@ func (c *Container) Stop() {
|
||||
}
|
||||
|
||||
func (c *Container) Remove() {
|
||||
if c.Meta["state"] == "exited" {
|
||||
if err := c.manager.Remove(); err != nil {
|
||||
log.Warningf("container %s: %v", c.Id, err)
|
||||
}
|
||||
if err := c.manager.Remove(); err != nil {
|
||||
log.Warningf("container %s: %v", c.Id, err)
|
||||
}
|
||||
}
|
||||
|
2
menus.go
2
menus.go
@ -129,7 +129,7 @@ func ContainerMenu() MenuFn {
|
||||
if c.Meta["state"] == "running" {
|
||||
items = append(items, menu.Item{Val: "stop", Label: "stop"})
|
||||
}
|
||||
if c.Meta["state"] == "exited" {
|
||||
if c.Meta["state"] == "exited" || c.Meta["state"] == "created" {
|
||||
items = append(items, menu.Item{Val: "start", Label: "start"})
|
||||
items = append(items, menu.Item{Val: "remove", Label: "remove"})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user