remove more cruft

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-07 20:20:16 -07:00
parent 6c5af117f2
commit 5dcbe40e76
1 changed files with 5 additions and 28 deletions

33
gui.go
View File

@ -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()
}