remove more cruft
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
6c5af117f2
commit
5dcbe40e76
33
gui.go
33
gui.go
|
@ -1,10 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
import "io/ioutil"
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import "github.com/mitchellh/go-homedir"
|
|
||||||
import "strings"
|
|
||||||
|
|
||||||
import "github.com/gookit/config"
|
import "github.com/gookit/config"
|
||||||
import "github.com/andlabs/ui"
|
import "github.com/andlabs/ui"
|
||||||
|
@ -28,34 +25,10 @@ func hostnameButton(hostname string) ui.Control {
|
||||||
tmpButton := ui.NewButton(hostname)
|
tmpButton := ui.NewButton(hostname)
|
||||||
tmpbox.Append(tmpButton, false)
|
tmpbox.Append(tmpButton, false)
|
||||||
tmpButton.OnClicked(buttonClick)
|
tmpButton.OnClicked(buttonClick)
|
||||||
/*
|
|
||||||
tmpButton.OnClicked(func(*ui.Button) {
|
|
||||||
log.Println("hostname =", config.String("hostname"), tmpButton)
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
return tmpbox
|
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 {
|
func makeButtonsPage(names []string) ui.Control {
|
||||||
vbox := ui.NewVerticalBox()
|
vbox := ui.NewVerticalBox()
|
||||||
vbox.SetPadded(true)
|
vbox.SetPadded(true)
|
||||||
|
@ -264,6 +237,10 @@ func setupUI() {
|
||||||
tabcount += 1
|
tabcount += 1
|
||||||
maintab.SetMargined(tabcount, true)
|
maintab.SetMargined(tabcount, true)
|
||||||
|
|
||||||
|
maintab.Append("Group examples", makeGroupEntries())
|
||||||
|
tabcount += 1
|
||||||
|
maintab.SetMargined(tabcount, true)
|
||||||
|
|
||||||
mainwin.Show()
|
mainwin.Show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue