diff --git a/gui.go b/gui.go index c1bce42..c61e202 100644 --- a/gui.go +++ b/gui.go @@ -64,29 +64,12 @@ type ButtonMap struct { Note string // what type of button } -func setupUI() { - Data.mainwin = ui.NewWindow("Cloud Control Panel", Data.Width, Data.Height, false) - Data.mainwin.OnClosing(func(*ui.Window) bool { - ui.Quit() - return true - }) - ui.OnShouldQuit(func() bool { - Data.mainwin.Destroy() - return true - }) - - Data.maintab = ui.NewTab() - Data.mainwin.SetChild(Data.maintab) - Data.mainwin.SetMargined(true) - - Data.tabcount = 0 - Data.mainwin.Show() -} - +/* func AddNewTab(mytab *ui.Tab, newbox ui.Control, tabOffset int) { mytab.Append("Cloud Info", newbox) mytab.SetMargined(tabOffset, true) } +*/ func InitColumns(mh *TableData, parts []TableColumnData) { tmpBTindex := 0 @@ -182,13 +165,6 @@ func AddTableTab(mytab *ui.Tab, mytabcount int, name string, rowcount int, parts return mh } -func DoGUI() { - for { - ui.Main(setupUI) - log.Println("GUI exited. Not sure what to do here. os.Exit() ?") - } -} - func defaultButtonClick(button *ui.Button) { log.Println("defaultButtonClick() button =", button) for key, foo := range Data.allButtons { diff --git a/infoTabUI.go b/infoTabUI.go index e2867bd..ca94427 100644 --- a/infoTabUI.go +++ b/infoTabUI.go @@ -5,6 +5,7 @@ import "time" import "fmt" import "runtime/debug" import "runtime" +import "os" import "github.com/gookit/config" @@ -51,12 +52,11 @@ func makeCloudInfoBox(custom func(int, string)) *ui.Box { vbox.SetPadded(true) hbox.Append(vbox, true) + /* grid := ui.NewGrid() grid.SetPadded(true) vbox.Append(grid, false) - - msggrid := ui.NewGrid() - msggrid.SetPadded(true) + */ entryForm := ui.NewForm() entryForm.SetPadded(true) @@ -70,6 +70,22 @@ func makeCloudInfoBox(custom func(int, string)) *ui.Box { entryForm.Append("IPv6:", IPv6entry, false) IPv6entry.SetText("2604:bbc0:3:3:0:10:0:1003") + vbox.Append(ui.NewHorizontalSeparator(), false) + + vbox.Append(ui.NewLabel("Accounts:"), false) + + agrid := ui.NewGrid() + agrid.SetPadded(true) + + for account, _ := range config.StringMap("accounts") { + hostname := config.String("cloud." + account + ".hostname") + domainname := config.String("cloud." + account + ".hostname") + port := config.String("cloud." + account + ".port") + a := account + " " + hostname + " " + domainname + " " + port + log.Println("ACCOUNT: ", a) + vbox.Append(ui.NewLabel(a), false) + } + os.Exit(0) return hbox }