From 5dcbe40e76eb57a5bb3012b33218f5e9cc56315d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 May 2019 20:20:16 -0700 Subject: [PATCH] remove more cruft Signed-off-by: Jeff Carr --- gui.go | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/gui.go b/gui.go index 6c6e7b1..63a9406 100644 --- a/gui.go +++ b/gui.go @@ -1,10 +1,7 @@ package main import "log" -import "io/ioutil" import "fmt" -import "github.com/mitchellh/go-homedir" -import "strings" import "github.com/gookit/config" import "github.com/andlabs/ui" @@ -28,34 +25,10 @@ func hostnameButton(hostname string) ui.Control { tmpButton := ui.NewButton(hostname) tmpbox.Append(tmpButton, false) tmpButton.OnClicked(buttonClick) -/* - tmpButton.OnClicked(func(*ui.Button) { - log.Println("hostname =", config.String("hostname"), tmpButton) - }) -*/ + return tmpbox } -func getPhysicalMachines(machineType string) []string { - var machines []string - home, _ := homedir.Dir() - files, err := ioutil.ReadDir(home+"/wit/ansible/inventory-usw2/host_vars/") - if err != nil { - log.Println(err) - return machines - } - - for _, f := range files { - s := strings.Split(f.Name(), ".") - if strings.HasPrefix(s[1], machineType) { - fmt.Println(f.Name(), s) - machines = append(machines, f.Name()) - } - } - return machines -} - - func makeButtonsPage(names []string) ui.Control { vbox := ui.NewVerticalBox() vbox.SetPadded(true) @@ -264,6 +237,10 @@ func setupUI() { tabcount += 1 maintab.SetMargined(tabcount, true) + maintab.Append("Group examples", makeGroupEntries()) + tabcount += 1 + maintab.SetMargined(tabcount, true) + mainwin.Show() }