summaryrefslogtreecommitdiff
path: root/doGui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-15 06:44:25 -0600
committerJeff Carr <[email protected]>2025-02-15 07:28:39 -0600
commitd3b6c1725d1657d20ba843e5f1323ab8019ea9d1 (patch)
tree8cb245f9c747bce31ed3a06c80e9cee72425d4cb /doGui.go
parent875da60adb56ba8b88301d19f19b3b7fac2d88c0 (diff)
preliminary table
Diffstat (limited to 'doGui.go')
-rw-r--r--doGui.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/doGui.go b/doGui.go
index 7db0ae4..e9b22c5 100644
--- a/doGui.go
+++ b/doGui.go
@@ -6,6 +6,7 @@ package main
// An app to submit patches for the 30 GO GUI repos
import (
+ "fmt"
"os"
"time"
@@ -58,6 +59,7 @@ func drawWindow(win *gadgets.BasicWindow) {
if tbwin == nil {
log.Info("show zoo here")
tbwin = makeTableWindow()
+ tbwin.showTable(me.machines)
}
if tbwin.Hidden() {
@@ -86,6 +88,19 @@ func (tw *tableWindow) showTable(allm *zoopb.Machines) {
tw.grid.NewLabel("hello")
tw.grid.NewLabel(m.Hostname)
+ tw.grid.NewLabel(fmt.Sprintf("%d", m.Cpus))
+ tw.grid.NewLabel(fmt.Sprintf("%d", m.Memory))
+ tw.grid.NewLabel(m.Distro)
+ tw.grid.NewLabel(findVersion(m, "zood"))
+ tw.grid.NewLabel(findVersion(m, "bash"))
tw.grid.NextRow()
}
}
+
+func findVersion(m *zoopb.Machine, pkgname string) string {
+ zood := m.Packages.FindByName(pkgname)
+ if zood == nil {
+ return "n/a"
+ }
+ return zood.Version
+}