mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 23:26:45 +08:00
cap cpu gauge % to 100 in compact view
This commit is contained in:
@@ -30,6 +30,9 @@ func (row *Compact) SetCPU(val int) {
|
|||||||
val = 5
|
val = 5
|
||||||
row.Cpu.BarColor = ui.ThemeAttr("gauge.bar.bg")
|
row.Cpu.BarColor = ui.ThemeAttr("gauge.bar.bg")
|
||||||
}
|
}
|
||||||
|
if val > 100 {
|
||||||
|
val = 100
|
||||||
|
}
|
||||||
row.Cpu.Percent = val
|
row.Cpu.Percent = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user