add WidgetUpdater interface to container, replace struct fields with metamap

This commit is contained in:
Bradley Cicenas
2017-03-06 08:25:59 +00:00
parent e1dc42db03
commit f102e48cc9
8 changed files with 48 additions and 42 deletions

View File

@@ -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
}