summaryrefslogtreecommitdiff
path: root/windowZooPB.go
diff options
context:
space:
mode:
Diffstat (limited to 'windowZooPB.go')
-rw-r--r--windowZooPB.go59
1 files changed, 14 insertions, 45 deletions
diff --git a/windowZooPB.go b/windowZooPB.go
index 154335b..5f7eb74 100644
--- a/windowZooPB.go
+++ b/windowZooPB.go
@@ -8,56 +8,25 @@ import (
"time"
"go.wit.com/gui"
- "go.wit.com/lib/gadgets"
"go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
)
-func addButtonForZooPB(grid *gui.Node) (*gui.Node, *gadgets.GenericWindow) {
- var win *gadgets.GenericWindow
- b := grid.NewButton("show zoo", func() {
- // if the window exists, just toggle it open or closed
- if win != nil {
- win.Toggle()
- return
- }
-
- win = gadgets.NewGenericWindow("Zoo Raw PB View", "Stuff")
- win.Win.Custom = func() {
- log.Info("test delete window here")
- }
- tbox := win.Bottom.Box().SetProgName("TBOX")
- grid := win.Group.RawGrid()
-
- var t *zoopb.MachinesTable
- grid.NewButton("Show", func() {
- if t != nil {
- t.Delete()
- t = nil
- }
-
- // display the protobuf
- t = AddMachinesPB(tbox, me.machines)
- f := func(m *zoopb.Machine) {
- log.Info("got to MachinesTable.Custom() ", m.Hostname)
- }
- t.Custom(f)
- log.Info("table has uuid", t.GetUuid())
- })
+func doMachinesUpgradeTable() {
+ if me.machinesTB != nil {
+ me.machinesTB.Delete()
+ me.machinesTB = nil
+ }
- grid.NewButton("update", func() {
- if t != nil {
- t.Delete()
- t = nil
- }
- t = AddMachinesPB(tbox, me.machines)
- log.Info("table has uuid", t.GetUuid())
- })
- grid.NewButton("ListChildren", func() {
- me.myGui.ListChildren(false)
- })
- })
- return b, win
+ // display the protobuf
+ me.machinesTB = AddMachinesPB(me.machinesBox, me.machines)
+ f := func(m *zoopb.Machine) {
+ log.Info("upgrade machine", m.Hostname, "memory", m.Memory/(1024*1024*1024))
+ log.Info("ADD THE CODE TO TRIGGER AN UPGRADE HERE")
+ log.Info("ADD THE CODE TO TRIGGER AN UPGRADE HERE")
+ }
+ me.machinesTB.Custom(f)
+ log.Info("table has uuid", me.machinesTB.GetUuid())
}
func AddMachinesPB(tbox *gui.Node, pb *zoopb.Machines) *zoopb.MachinesTable {