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 +} diff --git a/http.go b/http.go index 34b2d35..827f5e1 100644 --- a/http.go +++ b/http.go @@ -6,6 +6,7 @@ import ( "net/http" "strings" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" ) @@ -39,7 +40,8 @@ func okHandler(w http.ResponseWriter, r *http.Request) { var m *zoopb.Machine m = new(zoopb.Machine) if err := m.Unmarshal(msg); err != nil { - log.Info("proto.Unmarshal() failed on wire message len", len(msg)) + log.Info("zoo host sent unknown machine protobuf len", len(msg)) + forgepb.IdentifyProtobuf(msg) log.Info("error =", err) return }