adds machines to table

This commit is contained in:
Jeff Carr 2025-02-15 04:12:27 -06:00
parent 25bc18c55f
commit 875da60adb
2 changed files with 38 additions and 16 deletions

View File

@ -11,6 +11,7 @@ import (
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
)
@ -54,16 +55,37 @@ func drawWindow(win *gadgets.BasicWindow) {
win.Disable()
defer win.Enable()
if tbwin != nil {
if tbwin.Hidden() {
tbwin.Show()
} else {
tbwin.Hide()
}
return
if tbwin == nil {
log.Info("show zoo here")
tbwin = makeTableWindow()
}
log.Info("show zoo here")
tbwin = makeTableWindow()
if tbwin.Hidden() {
tbwin.Show()
} else {
tbwin.Hide()
}
return
})
grid.NewButton("addTable", func() {
if tbwin == nil {
log.Info("show the table first")
return
}
tbwin.showTable(me.machines)
})
}
func (tw *tableWindow) showTable(allm *zoopb.Machines) {
all := allm.All()
for all.Scan() {
m := all.Next()
tw.grid.NewLabel("hello")
tw.grid.NewLabel(m.Hostname)
tw.grid.NextRow()
}
}

View File

@ -81,13 +81,13 @@ func makeTableWindow() *tableWindow {
// make a grid to put the list of git repos that have patches
// in this particular patchset
grid = g.NewGrid("", 0, 0)
grid.NewLabel("repo")
grid.NewLabel("patch name")
grid.NewLabel("Applied in current branch?")
grid.NewLabel("start hash")
grid.NewLabel("")
grid.NextRow()
pw.grid = g.NewGrid("", 0, 0)
pw.grid.NewLabel("repo")
pw.grid.NewLabel("patch name")
pw.grid.NewLabel("Applied in current branch?")
pw.grid.NewLabel("start hash")
pw.grid.NewLabel("")
pw.grid.NextRow()
// add the patches to the grid
// pw.addPatchset(grid, pset)