time in a table works
This commit is contained in:
parent
d667d8c26a
commit
e9f7b99846
8
doGui.go
8
doGui.go
|
@ -80,9 +80,17 @@ func drawWindow(win *gadgets.BasicWindow) {
|
||||||
grid.NewButton("me.machines.ShowTable()", func() {
|
grid.NewButton("me.machines.ShowTable()", func() {
|
||||||
t := me.machines.NewTable("test 2")
|
t := me.machines.NewTable("test 2")
|
||||||
t.AddHostname()
|
t.AddHostname()
|
||||||
|
t.AddMemory()
|
||||||
|
t.AddCpus()
|
||||||
t.AddStringFunc("sMB", func(m *zoopb.Machine) string {
|
t.AddStringFunc("sMB", func(m *zoopb.Machine) string {
|
||||||
return fmt.Sprintf("%d mb", m.Memory/(1024*1024))
|
return fmt.Sprintf("%d mb", m.Memory/(1024*1024))
|
||||||
})
|
})
|
||||||
|
t.AddStringFunc("zood", func(m *zoopb.Machine) string {
|
||||||
|
return findVersion(m, "zood")
|
||||||
|
})
|
||||||
|
t.AddTimeFunc("age", func(m *zoopb.Machine) time.Time {
|
||||||
|
return m.Laststamp.AsTime()
|
||||||
|
})
|
||||||
t.ShowTable()
|
t.ShowTable()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue