2025-02-15 03:45:32 -06:00
|
|
|
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by the GPL 3.0
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
// An app to submit patches for the 30 GO GUI repos
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"go.wit.com/gui"
|
|
|
|
"go.wit.com/lib/gadgets"
|
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
|
|
|
|
2025-03-06 04:36:07 -06:00
|
|
|
// refresh the windows & tables the user has open
|
|
|
|
func refresh() {
|
|
|
|
time.Sleep(90 * time.Second)
|
|
|
|
if argv.Verbose {
|
|
|
|
log.Info("zookeeper scan here")
|
|
|
|
}
|
|
|
|
if me.zood != nil {
|
|
|
|
doMachinesUpgradeTable()
|
2025-02-15 03:45:32 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func doGui() {
|
|
|
|
me.myGui = gui.New()
|
|
|
|
me.myGui.InitEmbed(resources)
|
|
|
|
me.myGui.Default()
|
|
|
|
|
2025-03-05 07:46:05 -06:00
|
|
|
win := gadgets.RawBasicWindow("Zookeeper: (inventory your cluster)")
|
|
|
|
win.Make()
|
|
|
|
win.Show()
|
|
|
|
win.Custom = func() {
|
2025-02-15 03:45:32 -06:00
|
|
|
log.Warn("Main window close")
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
box := win.Box()
|
|
|
|
|
|
|
|
vbox := box.NewVerticalBox("BOX2")
|
|
|
|
|
|
|
|
group1 := vbox.NewGroup("Zookeeper Settings")
|
|
|
|
grid := group1.NewGrid("buildOptions", 0, 0)
|
|
|
|
|
2025-03-06 04:36:07 -06:00
|
|
|
grid.NewButton("zood versions", func() {
|
2025-03-06 03:54:08 -06:00
|
|
|
// if the window exists, just toggle it open or closed
|
2025-03-06 04:36:07 -06:00
|
|
|
if me.zood != nil {
|
|
|
|
me.zood.Toggle()
|
2025-03-06 03:54:08 -06:00
|
|
|
return
|
|
|
|
}
|
2025-03-06 04:36:07 -06:00
|
|
|
makeZoodWin()
|
|
|
|
})
|
2025-02-15 04:12:27 -06:00
|
|
|
|
2025-03-06 05:16:00 -06:00
|
|
|
grid.NewButton("Cluster Events", func() {
|
|
|
|
log.Info("todo: start a list here!")
|
|
|
|
})
|
|
|
|
|
2025-03-06 04:36:07 -06:00
|
|
|
// sit here forever refreshing the GUI
|
|
|
|
for {
|
|
|
|
refresh()
|
2025-02-15 06:44:25 -06:00
|
|
|
}
|
|
|
|
}
|