VM list works again
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
b7661667d1
commit
4df4f2bfd9
|
@ -9,11 +9,12 @@ import pb "git.wit.com/wit/witProtobuf"
|
||||||
func makeCloudInfoBox(gw *gui.GuiWindow) {
|
func makeCloudInfoBox(gw *gui.GuiWindow) {
|
||||||
log.Println("makeCloudInfoBox() START gw =", gw)
|
log.Println("makeCloudInfoBox() START gw =", gw)
|
||||||
|
|
||||||
gw.UiTab.Delete(0) // does this make things more or less stable or neither?
|
|
||||||
gw.Name = "Cloud Accounts"
|
|
||||||
gw = gui.InitGuiWindow(gw)
|
|
||||||
// TODO: make this text i18n
|
// TODO: make this text i18n
|
||||||
box := gui.HardBox(gw, gui.Yaxis, "Cloud Accounts")
|
box := gui.InitWindow(gw, "Cloud Accounts", gui.Yaxis)
|
||||||
|
if (box == nil) {
|
||||||
|
log.Println("gui.InitWindow() FAILED")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
log.Println("makeCloudInfoBox() START GW IS NOW: gw =", gw)
|
log.Println("makeCloudInfoBox() START GW IS NOW: gw =", gw)
|
||||||
log.Println("makeCloudInfoBox() box =", box)
|
log.Println("makeCloudInfoBox() box =", box)
|
||||||
|
@ -56,31 +57,8 @@ func makeCloudInfoBox(gw *gui.GuiWindow) {
|
||||||
log.Println("makeCloudInfoBox() END")
|
log.Println("makeCloudInfoBox() END")
|
||||||
}
|
}
|
||||||
|
|
||||||
// func createAccount(gw *gui.GuiWindow) {
|
|
||||||
func initWindow(gw *gui.GuiWindow, name string, axis int) *gui.GuiBox {
|
|
||||||
window := gui.Data.WindowMap[name]
|
|
||||||
if (window != nil) {
|
|
||||||
box := window.BoxMap["MAINBOX"]
|
|
||||||
log.Println("initWindow() tab already exists name =", name)
|
|
||||||
gui.ErrorWindow(box.Window, "Create Window Error", "Window " + name + " already exists")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// if there is not an account, then go to 'make account'
|
|
||||||
gw.Name = name
|
|
||||||
newWindow := gui.InitGuiWindow(gw)
|
|
||||||
|
|
||||||
var box *gui.GuiBox
|
|
||||||
if (axis == gui.Xaxis) {
|
|
||||||
box = gui.HardBox(newWindow, gui.Xaxis, name)
|
|
||||||
} else {
|
|
||||||
box = gui.HardBox(newWindow, gui.Yaxis, name)
|
|
||||||
}
|
|
||||||
return box
|
|
||||||
}
|
|
||||||
|
|
||||||
func createAccount(gw *gui.GuiWindow) {
|
func createAccount(gw *gui.GuiWindow) {
|
||||||
box := initWindow(gw, "Create New Account", gui.Yaxis)
|
box := gui.InitWindow(gw, "Create New Account", gui.Yaxis)
|
||||||
if (box == nil) { return }
|
if (box == nil) { return }
|
||||||
|
|
||||||
gw = box.Window
|
gw = box.Window
|
||||||
|
|
|
@ -89,13 +89,13 @@ func showAccountClick(b *gui.GuiButton) {
|
||||||
var values *myButtonInfo
|
var values *myButtonInfo
|
||||||
|
|
||||||
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
|
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
|
||||||
log.Println("\tmainMouseClick() values.Accounts error =", ok)
|
log.Println("\tshowAccountClick() values.Accounts error =", ok)
|
||||||
log.Println("\tmainMouseClick() values.Accounts tmp =", tmp)
|
log.Println("\tshowAccountClick() values.Accounts tmp =", tmp)
|
||||||
} else {
|
} else {
|
||||||
values = tmp
|
values = tmp
|
||||||
}
|
}
|
||||||
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
|
log.Println("\tshowAccountClick() values.Accounts =", values.Accounts)
|
||||||
log.Println("\tmainMouseClick() values.Name = ", values.Name)
|
log.Println("\tshowAccountClick() values.Name = ", values.Name)
|
||||||
|
|
||||||
gw := b.Box.Window
|
gw := b.Box.Window
|
||||||
|
|
||||||
|
@ -144,13 +144,13 @@ func createVmClick(b *gui.GuiButton) {
|
||||||
var values *myButtonInfo
|
var values *myButtonInfo
|
||||||
|
|
||||||
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
|
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
|
||||||
log.Println("\tmainMouseClick() values.Accounts error =", ok)
|
log.Println("\tcreateVmClick() values.Accounts error =", ok)
|
||||||
log.Println("\tmainMouseClick() values.Accounts tmp =", tmp)
|
log.Println("\tcreateVmClick() values.Accounts tmp =", tmp)
|
||||||
} else {
|
} else {
|
||||||
values = tmp
|
values = tmp
|
||||||
}
|
}
|
||||||
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
|
log.Println("\tcreateVmClick() values.Accounts =", values.Accounts)
|
||||||
log.Println("\tmainMouseClick() values.Name = ", values.Name)
|
log.Println("\tcreateVmClick() values.Name = ", values.Name)
|
||||||
|
|
||||||
log.Println("\tTRIGGER CREATE VM")
|
log.Println("\tTRIGGER CREATE VM")
|
||||||
State = "CREATE"
|
State = "CREATE"
|
||||||
|
|
|
@ -19,9 +19,7 @@ func debugClick(b *gui.GuiButton) {
|
||||||
log.Println("debugClick() START")
|
log.Println("debugClick() START")
|
||||||
gw := b.Box.Window
|
gw := b.Box.Window
|
||||||
|
|
||||||
// if there is not an account, then go to 'make account'
|
box := gui.InitWindow(gw, "Debugging", gui.Yaxis)
|
||||||
// gw = gui.InitGuiWindow("debugClick", gw)
|
|
||||||
box := initWindow(gw, "Debugging", gui.Yaxis)
|
|
||||||
if (box == nil) { return }
|
if (box == nil) { return }
|
||||||
log.Println("debugClick() initWindow() END")
|
log.Println("debugClick() initWindow() END")
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ func splashClick(b *gui.GuiButton) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
gw.UiTab.Delete(0) // does this make things more or less stable or neither?
|
// gw.UiTab.Delete(0) // does this make things more or less stable or neither?
|
||||||
createAccount(gw)
|
createAccount(gw)
|
||||||
log.Println("splashClick() END")
|
log.Println("splashClick() END")
|
||||||
}
|
}
|
||||||
|
|
17
gui-vm.go
17
gui-vm.go
|
@ -87,9 +87,11 @@ func createAddVmBox(b *gui.GuiButton) {
|
||||||
// gw.BoxMap["ADD VM" + name] = box
|
// gw.BoxMap["ADD VM" + name] = box
|
||||||
|
|
||||||
txt := "ADD VM " + name
|
txt := "ADD VM " + name
|
||||||
gw.Name = txt
|
box := gui.InitWindow(gw, txt, gui.Yaxis)
|
||||||
gw = gui.InitGuiWindow(gw)
|
if (box == nil) {
|
||||||
box := gui.HardBox(gw, gui.Yaxis, txt)
|
log.Println("initWindow() FAILED")
|
||||||
|
return
|
||||||
|
}
|
||||||
box = gui.HardBox(gw, gui.Xaxis, txt)
|
box = gui.HardBox(gw, gui.Xaxis, txt)
|
||||||
// box := gui.AddGenericBox(gw, name)
|
// box := gui.AddGenericBox(gw, name)
|
||||||
|
|
||||||
|
@ -118,9 +120,12 @@ func createVmBox(gw *gui.GuiWindow, vm *pb.Event_VM) {
|
||||||
log.Println("CreateVmBox() START vm.Name =", vm.Name)
|
log.Println("CreateVmBox() START vm.Name =", vm.Name)
|
||||||
|
|
||||||
txt := "VM " + vm.Name
|
txt := "VM " + vm.Name
|
||||||
gw.Name = txt
|
// TODO: make this text i18n
|
||||||
gw = gui.InitGuiWindow(gw)
|
box := gui.InitWindow(gw, txt, gui.Yaxis)
|
||||||
box := gui.HardBox(gw, gui.Yaxis, txt)
|
if (box == nil) {
|
||||||
|
log.Println("initWindow() FAILED")
|
||||||
|
return
|
||||||
|
}
|
||||||
box = gui.HardBox(gw, gui.Xaxis, txt)
|
box = gui.HardBox(gw, gui.Xaxis, txt)
|
||||||
|
|
||||||
// Add hostname entry box
|
// Add hostname entry box
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
8d39c04b6af88dddcaa05df2955c390b94f77ea1
|
Loading…
Reference in New Issue