diff --git a/Makefile b/Makefile index 058c2f0..3ef8ecd 100644 --- a/Makefile +++ b/Makefile @@ -31,3 +31,6 @@ update: # make the json config file human readable json-readable: cat /tmp/cloud-control-panel.json |jq -r --tab + +diff: + git diff diff --git a/infoTabUI.go b/infoTabUI.go index 01fb6d4..759e596 100644 --- a/infoTabUI.go +++ b/infoTabUI.go @@ -31,11 +31,22 @@ func makeCloudInfoBox() ui.Control { vbox.Append(ui.NewFontButton(), false) vbox.Append(ui.NewColorButton(), false) - mybutton := ui.NewButton("Test List VMs") + mybutton := ui.NewButton("cpuinfo") mybutton.OnClicked(func(*ui.Button) { log.Println("send over socket") + writelnToSocket("cpuinfo") }) vbox.Append(mybutton, false) + + // VM list test button + listVMbutton := ui.NewButton("list") + listVMbutton.OnClicked(func(*ui.Button) { + log.Println("send over socket") + writelnToSocket("list") + }) + vbox.Append(listVMbutton, false) + + vbox.Append(ui.NewLabel("Hostname:"), false) // ATTEMPT TO ADD THE TABLE HERE diff --git a/socketWIT.go b/socketWIT.go index 5761493..e0de047 100644 --- a/socketWIT.go +++ b/socketWIT.go @@ -10,28 +10,15 @@ import "strings" import "git.wit.com/wit/shell" import "git.wit.com/jcarr/dnssecsocket" -import "git.wit.com/wit/gui" + +// import "git.wit.com/wit/gui" //import "github.com/svent/go-nbreader" // import "github.com/gookit/config" // import "github.com/davecgh/go-spew/spew" -// reminder to use this for JSON -// https://github.com/tidwall/gjson -// value := gjson.Get(json, "name.last") -// println(value.String()) -// value := gjson.Get(json, friends.#[last=="Murphy"].first) - -// use mergo to merge structs -// import "github.com/imdario/mergo" -// mergo.Merge(&dest, src) - -// always sorted slice (new project) -// https://github.com/yaa110/sslice - var socketAlive bool = false - var connCurrent *net.TCPConn const ( @@ -112,13 +99,6 @@ func socketToWIT(myhostname string) { log.Println("LINE WAS:", text) log.Println("LINE WAS:", text) - if (text == "ADD") { - tmp := makeCloudInfoBox() - time.Sleep(1 * 1000 * 1000 * 1000) - gui.AddNewTab(jwcmaintab, tmp, 0) - continue - } - if (text == "ADD2") { add2() continue