fixes to the GUI

This commit is contained in:
Jeff Carr 2025-03-17 10:40:23 -05:00
parent a97379d76f
commit 03b03cb197
2 changed files with 26 additions and 24 deletions

View File

@ -29,9 +29,7 @@ func doGui() {
me.myGui.InitEmbed(resources)
me.myGui.Default()
mainWindow := gadgets.RawBasicWindow("Virtigo: (inventory your cluster)")
mainWindow.Make()
mainWindow.Show()
mainWindow := gadgets.NewGenericWindow("Virtigo: (inventory your cluster)", "Local Cluster Settings")
mainWindow.Custom = func() {
log.Warn("Main window close")
os.Exit(0)
@ -44,13 +42,8 @@ func doGui() {
}
func drawWindow(win *gadgets.BasicWindow) {
box := win.Box()
vbox := box.NewVerticalBox("BOX2")
group1 := vbox.NewGroup("Virtigo Settings")
grid := group1.NewGrid("buildOptions", 0, 0)
func drawWindow(win *gadgets.GenericWindow) {
grid := win.Group.RawGrid()
/*
var hyperWin *gadgets.GenericWindow
@ -101,16 +94,25 @@ func drawWindow(win *gadgets.BasicWindow) {
}
})
var eventWin *gadgets.GenericWindow
grid.NewButton("events)", func() {
log.Info("todo: make code for this")
if eventWin != nil {
eventWin.Toggle()
var ewin *stdEventTableWin
grid.NewButton("events", func() {
if ewin != nil {
log.Info("update events here")
e := me.cluster.GetEventsPB()
log.Info("Events len=", e.Len())
ewin.doStdEvents(e)
return
}
ewin = newEventsWindow()
ewin.win.Custom = func() {
log.Info("hiding table window")
}
e := me.cluster.GetEventsPB()
eventWin = makeEventsWindow(e)
log.Info("Events len=", e.Len())
ewin.doStdEvents(e)
})
grid.NextRow()
grid.NewButton("ConfigSave()", func() {
log.Info("todo: make code for this")
@ -125,16 +127,17 @@ func drawWindow(win *gadgets.BasicWindow) {
d := me.cluster.GetDropletsPB()
testWin, _ = makeDropletsWindow(d)
})
grid.NextRow()
me.status = grid.NewLabel("cur status")
grid.NextRow()
me.lastuptime = grid.NewLabel("last uptime")
grid.NextRow()
grid.NewButton("uptime", func() {
updateUptimeGui("kuma uptime should update this")
})
grid.NextRow()
grid = win.Middle.RawGrid()
me.status = grid.NewLabel("cur status")
grid.NextRow()
me.lastuptime = grid.NewLabel("last uptime")
grid.NextRow()
}
func updateUptimeGui(uptime string) {

View File

@ -147,9 +147,8 @@ func (dw *stdHypervisorTableWin) doNewStdHypervisors(pb *virtpb.Hypervisors) {
totalUnknownDroplets += 1
}
}
log.Printf("Total Droplets %d total libvirt only droplets = %d\n", totalDroplets, totalUnknownDroplets)
// log.Printf("Total Droplets %d total libvirt only droplets = %d\n", totalDroplets, totalUnknownDroplets)
return fmt.Sprintf("%d", totalDroplets)
// return "todo"
})
// display the protobuf