time in a table works

This commit is contained in:
Jeff Carr 2025-02-20 03:13:53 -06:00
parent d667d8c26a
commit e9f7b99846
1 changed files with 8 additions and 0 deletions

View File

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