diff options
| author | Jeff Carr <[email protected]> | 2025-02-22 22:17:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-23 13:13:30 -0600 |
| commit | 522723e9468fefabec1bb4bbd5b12c6fec51666d (patch) | |
| tree | bfff001778eaeb4bcd206be66a6cba6599a56555 | |
| parent | 32e27530075a09f5c3b82ca6cbb83a01e34cb24c (diff) | |
wow. all it took to make a table window for running droplets
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | doGui.go | 24 |
2 files changed, 22 insertions, 4 deletions
@@ -8,7 +8,7 @@ REDOMOD = $(shell if [ -e go.sum ]; then echo go.sum exists; else GO111MODULE= all: build ./virtigo --version - ./virtigo --gui gocui + @#./virtigo --gui gocui @echo build worked build: goimports vet @@ -61,6 +61,21 @@ func drawWindow(win *gadgets.BasicWindow) { testWin = makeDropletsWindow(d) }) + grid.NewButton("Running droplets", func() { + d := me.cluster.GetDropletsPB() + var found *virtpb.Droplets + found = virtpb.NewDroplets() + all := d.All() + for all.Scan() { + vm := all.Next() + if vm.Current.State != virtpb.DropletState_ON { + continue + } + found.Append(vm) + } + makeDropletsWindow(found) + }) + /* var test2 *genericWindow grid.NewButton("test2", func() { @@ -101,10 +116,13 @@ func makeDropletsWindow(pb *virtpb.Droplets) *genericWindow { t.AddHostname() t.AddMemory() t.AddCpus() + t.AddStringFunc("State", func(d *virtpb.Droplet) string { + if d.Current.State == virtpb.DropletState_ON { + return "ON" + } + return "UNKNOWN" + }) /* - t.AddStringFunc("sMB", func(m *zoopb.Machine) string { - return fmt.Sprintf("%d mb", m.Memory/(1024*1024)) - }) t.AddStringFunc("zood", func(m *zoopb.Machine) string { return findVersion(m, "zood") }) |
