start focusing on making a table for the VMs

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-06 09:51:16 -07:00
parent a07d6f6898
commit cbdf74a764
1 changed files with 4 additions and 31 deletions

35
main.go
View File

@ -64,27 +64,6 @@ func getPhysicalMachines(machineType string) []string {
}
func getPods(machineType string) []string {
var pods []string
home, _ := homedir.Dir()
files, err := ioutil.ReadDir(home+"/wit/docs/usw2/")
if err != nil {
log.Println(err)
return pods
}
for _, f := range files {
s := strings.Split(f.Name(), ".")
if strings.HasSuffix(f.Name(), machineType) {
fmt.Println("Adding k8s pod: ", f.Name(), s)
pods = append(pods, f.Name())
} else {
fmt.Println("Ignoring: ", f.Name(), s)
}
}
return pods
}
func makeButtonsPage(names []string) ui.Control {
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)
@ -284,23 +263,17 @@ func setupUI() {
mainwin.SetChild(tab)
mainwin.SetMargined(true)
tab.Append("Hypervisors", makeButtonsPage(getPhysicalMachines("h")))
tab.Append("v000185.testing.com.customers.wprod.wit.com", maketable())
tab.SetMargined(0, true)
tab.Append("Ceph", makeButtonsPage(getPhysicalMachines("d")))
tab.Append("Hypervisors", makeButtonsPage(getPhysicalMachines("h")))
tab.SetMargined(1, true)
tab.Append("k8s Pods", makeButtonsPage(getPods(".wit.com")))
tab.Append("VMs", makeNumbersPage())
tab.SetMargined(2, true)
tab.Append("VMs", makeNumbersPage())
tab.SetMargined(3, true)
tab.Append("Data Choosers", makeDataChoosersPage())
tab.SetMargined(4, true)
tab.Append("Table Test", maketable())
tab.SetMargined(5, true)
tab.SetMargined(3, true)
mainwin.Show()
}