diff options
Diffstat (limited to 'doAdminGui.go')
| -rw-r--r-- | doAdminGui.go | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/doAdminGui.go b/doAdminGui.go index 77f30bf..e7cdf48 100644 --- a/doAdminGui.go +++ b/doAdminGui.go @@ -108,55 +108,33 @@ func (admin *adminT) doAdminGui() { return } log.Info("Hypervisors len=", admin.hypervisors.Len()) - hwin := newHypervisorsWindow() - hwin.doStdHypervisors(admin.hypervisors) - hwin.win.Custom = func() { + admin.hwin = newHypervisorsWindow() + admin.hwin.doStdHypervisors(admin.hypervisors) + admin.hwin.win.Custom = func() { log.Info("hiding table window") } }) - grid.NewButton("show active droplets", func() { + grid.NewButton("droplets", func() { if admin.droplets == nil { log.Info("droplets not initialized") return } - var found *virtpb.Droplets - found = virtpb.NewDroplets() - all := admin.droplets.All() - for all.Scan() { - vm := all.Next() - if vm.Current.State != virtpb.DropletState_ON { - continue - } - found.Append(vm) - } - dropWin := newDropletsWindow() - dropWin.doActiveDroplets(found) - dropWin.win.Custom = func() { + admin.dwin = newDropletsWindow() + admin.dwin.win.Custom = func() { log.Info("hiding droplet table window") } - }) - - grid.NewButton("inactive droplets", func() { - if admin.droplets == nil { - log.Info("droplets not initialized") - return - } var found *virtpb.Droplets found = virtpb.NewDroplets() all := admin.droplets.All() for all.Scan() { vm := all.Next() - if vm.Current.State == virtpb.DropletState_ON { + if vm.Current.State != virtpb.DropletState_ON { continue } found.Append(vm) } - dropWin := newDropletsWindow() - dropWin.doInactiveDroplets(found) - dropWin.win.Custom = func() { - log.Info("hiding droplet table window") - } + admin.dwin.doActiveDroplets(found) }) grid.NewButton("events", func() { @@ -165,9 +143,9 @@ func (admin *adminT) doAdminGui() { return } log.Info("Events len=", admin.events.Len()) - hwin := newEventsWindow() - hwin.doStdEvents(admin.events) - hwin.win.Custom = func() { + admin.ewin = newEventsWindow() + admin.ewin.doStdEvents(admin.events) + admin.ewin.win.Custom = func() { log.Info("hiding table window") } }) |
