init expanded view, add cpu histogram

This commit is contained in:
Bradley Cicenas
2017-01-06 19:46:30 +00:00
parent bebdfd844f
commit 99aac17030
6 changed files with 162 additions and 2 deletions

View File

@@ -29,8 +29,15 @@ func NewContainer(c docker.APIContainers) *Container {
}
}
func (c *Container) Collect(client *docker.Client) {
func (c *Container) Expand() {
c.widgets = widgets.NewExpanded(c.id, c.name)
}
func (c *Container) Collapse() {
c.widgets = widgets.NewCompact(c.id, c.name)
}
func (c *Container) Collect(client *docker.Client) {
go func() {
opts := docker.StatsOptions{
ID: c.id,
@@ -49,5 +56,4 @@ func (c *Container) Collect(client *docker.Client) {
c.widgets.SetNet(c.reader.NetRx, c.reader.NetTx)
}
}()
}