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.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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue