diff options
| author | Jeff Carr <[email protected]> | 2025-02-18 20:10:51 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-19 17:39:45 -0600 |
| commit | 78cc971daa17ed4f8e626555a06aadc12a0a4b1d (patch) | |
| tree | 43a2f74ea029afff00246b58bcc433e75fe9f8f7 /machine.gui.go | |
| parent | df91ac2cbdd0dc6fef11bf98e367f5a185187680 (diff) | |
table tests
Diffstat (limited to 'machine.gui.go')
| -rw-r--r-- | machine.gui.go | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/machine.gui.go b/machine.gui.go index 9ef1f40..3791b71 100644 --- a/machine.gui.go +++ b/machine.gui.go @@ -1,14 +1,39 @@ package zoopb -/* -type RepoTable struct { - n *gui.Node - x *Repos - FullPath *repoTableFullPath - columns []*gui.NodeColumn - order []*gui.NodeColumn +import ( + "go.wit.com/gui" + "go.wit.com/lib/protobuf/guipb" + "go.wit.com/log" +) + +func (x *Machines) NewTable(title string) *MachinesTable { + t := new(MachinesTable) + t.gt = gui.NewTable(title) + t.x = x + pb := new(guipb.Table) + pb.Title = title + pb.Order = append(pb.Order, "Hostname") + pb.Order = append(pb.Order, "Memory") + pb.Order = append(pb.Order, "Cpus") + t.pb = pb + return t } +func (t *MachinesTable) ShowTable() { + log.Info("zoopb ShowTable()") + t.gt.ShowTable(t.pb) +} + +type MachinesTable struct { + gt *gui.NodeTable + pb *guipb.Table + x *Machines + hostnames []string + columns []*gui.NodeColumn + order []*gui.NodeColumn +} + +/* type RepoTableRow struct { nodes []*gui.Node } @@ -23,12 +48,6 @@ func (x *repoTableFullPath) Add(s string) { func (x *RepoTable) FullPath() *RepoTableFullPath { } -func (x *Repos) NewTable() *RepoTable { - t := new(RepoTable) - t.n = gui.NewTable() - return *RepoTable -} - func (x *RepoTable) AddFullPath() { x.order = append(x.order, x.n.AddStringFunc( f() string { return t.x.getRepoFullPath(rx *RepoTableRow) |
