mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
refactor config, add Switch and Param struct + config labels
This commit is contained in:
4
grid.go
4
grid.go
@@ -75,14 +75,14 @@ func (g *Grid) redrawRows() {
|
||||
ui.Clear()
|
||||
|
||||
// build layout
|
||||
if config.GetToggle("enableHeader") {
|
||||
if config.GetSwitch("enableHeader") {
|
||||
g.header.SetCount(len(g.containers))
|
||||
g.header.SetFilter(config.Get("filterStr"))
|
||||
ui.Body.AddRows(g.header.Row())
|
||||
}
|
||||
ui.Body.AddRows(fieldHeader())
|
||||
for _, c := range g.containers {
|
||||
if !config.GetToggle("allContainers") && c.state != "running" {
|
||||
if !config.GetSwitch("allContainers") && c.state != "running" {
|
||||
continue
|
||||
}
|
||||
ui.Body.AddRows(c.widgets.Row())
|
||||
|
||||
Reference in New Issue
Block a user