fixes to the GUI
This commit is contained in:
parent
a97379d76f
commit
03b03cb197
47
doGui.go
47
doGui.go
|
@ -29,9 +29,7 @@ func doGui() {
|
||||||
me.myGui.InitEmbed(resources)
|
me.myGui.InitEmbed(resources)
|
||||||
me.myGui.Default()
|
me.myGui.Default()
|
||||||
|
|
||||||
mainWindow := gadgets.RawBasicWindow("Virtigo: (inventory your cluster)")
|
mainWindow := gadgets.NewGenericWindow("Virtigo: (inventory your cluster)", "Local Cluster Settings")
|
||||||
mainWindow.Make()
|
|
||||||
mainWindow.Show()
|
|
||||||
mainWindow.Custom = func() {
|
mainWindow.Custom = func() {
|
||||||
log.Warn("Main window close")
|
log.Warn("Main window close")
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
@ -44,13 +42,8 @@ func doGui() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func drawWindow(win *gadgets.BasicWindow) {
|
func drawWindow(win *gadgets.GenericWindow) {
|
||||||
box := win.Box()
|
grid := win.Group.RawGrid()
|
||||||
|
|
||||||
vbox := box.NewVerticalBox("BOX2")
|
|
||||||
|
|
||||||
group1 := vbox.NewGroup("Virtigo Settings")
|
|
||||||
grid := group1.NewGrid("buildOptions", 0, 0)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var hyperWin *gadgets.GenericWindow
|
var hyperWin *gadgets.GenericWindow
|
||||||
|
@ -101,16 +94,25 @@ func drawWindow(win *gadgets.BasicWindow) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
var eventWin *gadgets.GenericWindow
|
var ewin *stdEventTableWin
|
||||||
grid.NewButton("events)", func() {
|
grid.NewButton("events", func() {
|
||||||
log.Info("todo: make code for this")
|
if ewin != nil {
|
||||||
if eventWin != nil {
|
log.Info("update events here")
|
||||||
eventWin.Toggle()
|
e := me.cluster.GetEventsPB()
|
||||||
|
log.Info("Events len=", e.Len())
|
||||||
|
ewin.doStdEvents(e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ewin = newEventsWindow()
|
||||||
|
ewin.win.Custom = func() {
|
||||||
|
log.Info("hiding table window")
|
||||||
|
}
|
||||||
|
|
||||||
e := me.cluster.GetEventsPB()
|
e := me.cluster.GetEventsPB()
|
||||||
eventWin = makeEventsWindow(e)
|
log.Info("Events len=", e.Len())
|
||||||
|
ewin.doStdEvents(e)
|
||||||
})
|
})
|
||||||
|
grid.NextRow()
|
||||||
|
|
||||||
grid.NewButton("ConfigSave()", func() {
|
grid.NewButton("ConfigSave()", func() {
|
||||||
log.Info("todo: make code for this")
|
log.Info("todo: make code for this")
|
||||||
|
@ -125,16 +127,17 @@ func drawWindow(win *gadgets.BasicWindow) {
|
||||||
d := me.cluster.GetDropletsPB()
|
d := me.cluster.GetDropletsPB()
|
||||||
testWin, _ = makeDropletsWindow(d)
|
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() {
|
grid.NewButton("uptime", func() {
|
||||||
updateUptimeGui("kuma uptime should update this")
|
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) {
|
func updateUptimeGui(uptime string) {
|
||||||
|
|
|
@ -147,9 +147,8 @@ func (dw *stdHypervisorTableWin) doNewStdHypervisors(pb *virtpb.Hypervisors) {
|
||||||
totalUnknownDroplets += 1
|
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 fmt.Sprintf("%d", totalDroplets)
|
||||||
// return "todo"
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// display the protobuf
|
// display the protobuf
|
||||||
|
|
Loading…
Reference in New Issue