mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add custom label formatting, scale for expandedMem
This commit is contained in:
@@ -30,8 +30,8 @@ func NewCompact(id string, name string) *Compact {
|
||||
Cid: compactPar(id),
|
||||
Net: compactPar("-"),
|
||||
Name: compactPar(name),
|
||||
Cpu: mkGauge(),
|
||||
Memory: mkGauge(),
|
||||
Cpu: slimGauge(),
|
||||
Memory: slimGauge(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,3 +82,14 @@ func (w *Compact) SetMem(val int64, limit int64, percent int) {
|
||||
}
|
||||
w.Memory.Percent = percent
|
||||
}
|
||||
|
||||
func slimGauge() *ui.Gauge {
|
||||
g := ui.NewGauge()
|
||||
g.Height = 1
|
||||
g.Border = false
|
||||
g.Percent = 0
|
||||
g.PaddingBottom = 0
|
||||
g.BarColor = ui.ColorGreen
|
||||
g.Label = "-"
|
||||
return g
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user