diff options
| author | Jeff Carr <[email protected]> | 2025-03-17 10:40:23 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-22 09:46:16 -0500 | 
| commit | 03b03cb197c249c374b0e6783cd57c49cd904c64 (patch) | |
| tree | 1d78de929f48a31e3f3dffb7989bfb04a73090ae | |
| parent | a97379d76fa34265221b9ab05a38c802f4a09cda (diff) | |
fixes to the GUI
| -rw-r--r-- | doGui.go | 43 | ||||
| -rw-r--r-- | windowHypervisors.go | 3 | 
2 files changed, 24 insertions, 22 deletions
@@ -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.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() - -	grid.NewButton("uptime", func() { -		updateUptimeGui("kuma uptime should update this") -	})  }  func updateUptimeGui(uptime string) { diff --git a/windowHypervisors.go b/windowHypervisors.go index 8e3dc27..3c07791 100644 --- a/windowHypervisors.go +++ b/windowHypervisors.go @@ -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  | 
