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:
@@ -65,7 +65,7 @@ func (cm *DockerContainerSource) refresh(c *Container) {
|
||||
cm.delByID(c.Id)
|
||||
return
|
||||
}
|
||||
c.SetName(shortName(insp.Name))
|
||||
c.SetMeta("name", shortName(insp.Name))
|
||||
c.SetState(insp.State.Status)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ func (cm *DockerContainerSource) refreshAll() {
|
||||
|
||||
for _, i := range allContainers {
|
||||
c := cm.MustGet(i.ID)
|
||||
c.SetName(shortName(i.Names[0]))
|
||||
c.SetMeta("name", shortName(i.Names[0]))
|
||||
c.SetState(i.State)
|
||||
cm.needsRefresh <- c.Id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user