mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add runtime config param for toggling all containers
This commit is contained in:
parent
9ddc99f788
commit
5f13563b6f
@ -62,6 +62,7 @@ func NewDefaultConfig() Config {
|
||||
|
||||
toggles := map[string]bool{
|
||||
"sortReverse": false,
|
||||
"allContainers": false,
|
||||
"enableHeader": false,
|
||||
"loggingEnabled": true,
|
||||
}
|
||||
|
7
grid.go
7
grid.go
@ -82,6 +82,9 @@ func (g *Grid) redrawRows() {
|
||||
}
|
||||
ui.Body.AddRows(fieldHeader())
|
||||
for _, c := range g.containers {
|
||||
if !config.GetToggle("allContainers") && c.state != "running" {
|
||||
continue
|
||||
}
|
||||
ui.Body.AddRows(c.widgets.Row())
|
||||
}
|
||||
|
||||
@ -154,6 +157,10 @@ func Display(g *Grid) bool {
|
||||
expand = true
|
||||
ui.StopLoop()
|
||||
})
|
||||
ui.Handle("/sys/kbd/a", func(ui.Event) {
|
||||
config.Toggle("allContainers")
|
||||
g.redrawRows()
|
||||
})
|
||||
ui.Handle("/sys/kbd/f", func(ui.Event) {
|
||||
menu = FilterMenu
|
||||
ui.StopLoop()
|
||||
|
Loading…
Reference in New Issue
Block a user