dumps the vm list

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-10 01:45:10 -07:00
parent 5f8efcb81d
commit fad05b3ffa
3 changed files with 17 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -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