mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add WidgetUpdater interface to container, replace struct fields with metamap
This commit is contained in:
@@ -46,6 +46,15 @@ func NewCompact(id string) *Compact {
|
||||
//}
|
||||
//}
|
||||
|
||||
func (row *Compact) SetMeta(k, v string) {
|
||||
switch k {
|
||||
case "name":
|
||||
row.Name.Set(v)
|
||||
case "state":
|
||||
row.Status.Set(v)
|
||||
}
|
||||
}
|
||||
|
||||
func (row *Compact) SetMetrics(m metrics.Metrics) {
|
||||
row.SetCPU(m.CPUUtil)
|
||||
row.SetNet(m.NetRx, m.NetTx)
|
||||
|
||||
Reference in New Issue
Block a user