code cleanup

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-12 23:02:10 -07:00
parent 66924bb35f
commit 184bdd6677
3 changed files with 13 additions and 32 deletions

View File

@ -72,15 +72,6 @@ func parseConfig() {
config.LoadOSEnv([]string{"USER"})
config.LoadOSEnv([]string{"BUILDDEBUG"})
/*
urls := flag.Args()
log.Println("flag.Aargs() = ", urls)
for _, addr := range flag.Args() {
log.Println("GET %s", addr)
}
*/
// add driver for support of yaml and json
config.AddDriver(yaml.Driver)
config.AddDriver(json.Driver)

View File

@ -173,28 +173,6 @@ func addTableTab() {
gui.AddTableTab(cloudtab, 1, "test seven", 7, parts)
}
func addProtobufTab() {
var parts []gui.InputData
for key, foo := range []string{"BG", "TEXTCOLOR", "BUTTON", "TEXTCOLOR", "TEXTCOLOR", "TEXT", "BUTTON", "TEXT", "BUTTON"} {
log.Println(key, foo)
var b gui.InputData
b.CellType = foo
b.Heading = fmt.Sprintf("heading%d", key)
parts = append(parts, b)
}
log.Println("Sleep for 2 seconds, then try to add new tabs")
time.Sleep(1 * 1000 * 1000 * 1000)
gui.AddTableTab(cloudtab, 1, "test seven", 7, parts)
}
type aheader struct {
headtype string
name string
}
func addVmsTab(count int) *gui.TableData {
var parts []gui.InputData
@ -212,33 +190,42 @@ func addVmsTab(count int) *gui.TableData {
tmp.Heading = "name"
tmp.Index = human
parts = append(parts, tmp)
human += 1
tmp = gui.InputData{}
tmp.CellType = "TEXTCOLOR"
tmp.Heading = "hostname"
tmp.Index = human
parts = append(parts, tmp)
human += 1
tmp = gui.InputData{}
tmp.CellType = "TEXTCOLOR"
tmp.Heading = "IPv6"
tmp.Index = human
parts = append(parts, tmp)
human += 1
tmp = gui.InputData{}
tmp.CellType = "TEXTCOLOR"
tmp.Heading = "cpus"
tmp.Index = human
parts = append(parts, tmp)
human += 1
tmp = gui.InputData{}
tmp.CellType = "TEXTCOLOR"
tmp.Heading = "memory"
tmp.Index = human
parts = append(parts, tmp)
human += 1
tmp = gui.InputData{}
tmp.CellType = "BUTTON"
tmp.Heading = "Details"
tmp.Index = human
parts = append(parts, tmp)
human += 1
mh := gui.AddTableTab(cloudtab, 1, "Virtual Machines", count, parts)
return mh

View File

@ -10,7 +10,7 @@ import "github.com/gookit/config"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
// import "git.wit.com/wit/gui"
import "git.wit.com/wit/gui"
// import "github.com/davecgh/go-spew/spew"
@ -64,6 +64,9 @@ func main() {
go gorillaDial("v000185.testing.com.customers.wprod.wit.com:9000")
gui.Width = config.Int("width")
gui.Height = config.Int("height")
// make this the main loop in an attempt to figure out the crashes
// do not change this until the GUI is stable
ui.Main(setupCloudUI)