adds machines to table
This commit is contained in:
parent
25bc18c55f
commit
875da60adb
40
doGui.go
40
doGui.go
|
@ -11,6 +11,7 @@ import (
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
|
"go.wit.com/lib/protobuf/zoopb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,16 +55,37 @@ func drawWindow(win *gadgets.BasicWindow) {
|
||||||
win.Disable()
|
win.Disable()
|
||||||
defer win.Enable()
|
defer win.Enable()
|
||||||
|
|
||||||
if tbwin != nil {
|
if tbwin == nil {
|
||||||
if tbwin.Hidden() {
|
log.Info("show zoo here")
|
||||||
tbwin.Show()
|
tbwin = makeTableWindow()
|
||||||
} else {
|
|
||||||
tbwin.Hide()
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("show zoo here")
|
if tbwin.Hidden() {
|
||||||
tbwin = makeTableWindow()
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -81,13 +81,13 @@ func makeTableWindow() *tableWindow {
|
||||||
|
|
||||||
// make a grid to put the list of git repos that have patches
|
// make a grid to put the list of git repos that have patches
|
||||||
// in this particular patchset
|
// in this particular patchset
|
||||||
grid = g.NewGrid("", 0, 0)
|
pw.grid = g.NewGrid("", 0, 0)
|
||||||
grid.NewLabel("repo")
|
pw.grid.NewLabel("repo")
|
||||||
grid.NewLabel("patch name")
|
pw.grid.NewLabel("patch name")
|
||||||
grid.NewLabel("Applied in current branch?")
|
pw.grid.NewLabel("Applied in current branch?")
|
||||||
grid.NewLabel("start hash")
|
pw.grid.NewLabel("start hash")
|
||||||
grid.NewLabel("")
|
pw.grid.NewLabel("")
|
||||||
grid.NextRow()
|
pw.grid.NextRow()
|
||||||
|
|
||||||
// add the patches to the grid
|
// add the patches to the grid
|
||||||
// pw.addPatchset(grid, pset)
|
// pw.addPatchset(grid, pset)
|
||||||
|
|
Loading…
Reference in New Issue