diff options
| author | Jeff Carr <[email protected]> | 2025-04-22 18:49:00 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-04-22 18:49:00 -0500 |
| commit | 4332b3d31a6973a42432d556ae6df3ef721a36fe (patch) | |
| tree | 4aa0513854c9778972bb2d637b9aee898302545f /doAdminGui.go | |
| parent | 2c5701eecad39fd77010f1886d5ad4cd3ad2d34f (diff) | |
working on a droplet edit window
Diffstat (limited to 'doAdminGui.go')
| -rw-r--r-- | doAdminGui.go | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/doAdminGui.go b/doAdminGui.go index 544ee06..1909fe1 100644 --- a/doAdminGui.go +++ b/doAdminGui.go @@ -22,14 +22,14 @@ import ( ) // refresh the windows & tables the user has open -func (admin *adminT) refresh() { +func (admin *adminT) refresh() error { if argv.Verbose { log.Info("virtigo scan here") } if admin.url == nil { log.Info("admin url == nil") - return + return fmt.Errorf("admin url == nil") } msg := []byte(`{"message": "Hello"}`) @@ -50,7 +50,7 @@ func (admin *adminT) refresh() { admin.cluster.Droplets = new(virtpb.Droplets) if err := admin.cluster.Droplets.Unmarshal(data); err != nil { fmt.Println("droplets marshal failed", err) - return + return err } fmt.Println("Droplet len=", admin.cluster.Droplets.Len()) } @@ -63,7 +63,7 @@ func (admin *adminT) refresh() { admin.cluster.Hypervisors = new(virtpb.Hypervisors) if err := admin.cluster.Hypervisors.Unmarshal(data); err != nil { fmt.Println("hypervisors marshal failed", err) - return + return err } fmt.Println("Hypervisors len=", admin.cluster.Hypervisors.Len()) } @@ -76,10 +76,11 @@ func (admin *adminT) refresh() { admin.cluster.Events = new(virtpb.Events) if err := admin.cluster.Events.Unmarshal(data); err != nil { fmt.Println("events marshal failed", err) - return + return err } fmt.Println("Events len=", admin.cluster.Events.Len()) } + return nil } var client *http.Client @@ -356,6 +357,10 @@ func (admin *adminT) makeClusterGroup(c *virtpb.Cluster) { admin.refresh() }) + if err := admin.refresh(); err != nil { + return + } + grid.NewButton("save cluster.pb", func() { admin.cluster.ConfigSave() }) @@ -407,7 +412,7 @@ func (admin *adminT) postEvent(e *virtpb.Event) error { } } if result.Error != "" { - return fmt.Errorf(result.Error) + return fmt.Errorf("%s", result.Error) } log.Printf("Event worked: %s\n", result.DropletUuid) return nil |
