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) {
|
||||
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
|
||||
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() box =", box)
|
||||
|
@ -56,31 +57,8 @@ func makeCloudInfoBox(gw *gui.GuiWindow) {
|
|||
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) {
|
||||
box := initWindow(gw, "Create New Account", gui.Yaxis)
|
||||
box := gui.InitWindow(gw, "Create New Account", gui.Yaxis)
|
||||
if (box == nil) { return }
|
||||
|
||||
gw = box.Window
|
||||
|
|
|
@ -89,13 +89,13 @@ func showAccountClick(b *gui.GuiButton) {
|
|||
var values *myButtonInfo
|
||||
|
||||
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
|
||||
log.Println("\tmainMouseClick() values.Accounts error =", ok)
|
||||
log.Println("\tmainMouseClick() values.Accounts tmp =", tmp)
|
||||
log.Println("\tshowAccountClick() values.Accounts error =", ok)
|
||||
log.Println("\tshowAccountClick() values.Accounts tmp =", tmp)
|
||||
} else {
|
||||
values = tmp
|
||||
}
|
||||
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
|
||||
log.Println("\tmainMouseClick() values.Name = ", values.Name)
|
||||
log.Println("\tshowAccountClick() values.Accounts =", values.Accounts)
|
||||
log.Println("\tshowAccountClick() values.Name = ", values.Name)
|
||||
|
||||
gw := b.Box.Window
|
||||
|
||||
|
@ -144,13 +144,13 @@ func createVmClick(b *gui.GuiButton) {
|
|||
var values *myButtonInfo
|
||||
|
||||
if tmp, ok := b.Values.(*myButtonInfo); ! ok {
|
||||
log.Println("\tmainMouseClick() values.Accounts error =", ok)
|
||||
log.Println("\tmainMouseClick() values.Accounts tmp =", tmp)
|
||||
log.Println("\tcreateVmClick() values.Accounts error =", ok)
|
||||
log.Println("\tcreateVmClick() values.Accounts tmp =", tmp)
|
||||
} else {
|
||||
values = tmp
|
||||
}
|
||||
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
|
||||
log.Println("\tmainMouseClick() values.Name = ", values.Name)
|
||||
log.Println("\tcreateVmClick() values.Accounts =", values.Accounts)
|
||||
log.Println("\tcreateVmClick() values.Name = ", values.Name)
|
||||
|
||||
log.Println("\tTRIGGER CREATE VM")
|
||||
State = "CREATE"
|
||||
|
|
|
@ -19,9 +19,7 @@ func debugClick(b *gui.GuiButton) {
|
|||
log.Println("debugClick() START")
|
||||
gw := b.Box.Window
|
||||
|
||||
// if there is not an account, then go to 'make account'
|
||||
// gw = gui.InitGuiWindow("debugClick", gw)
|
||||
box := initWindow(gw, "Debugging", gui.Yaxis)
|
||||
box := gui.InitWindow(gw, "Debugging", gui.Yaxis)
|
||||
if (box == nil) { return }
|
||||
log.Println("debugClick() initWindow() END")
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ func splashClick(b *gui.GuiButton) {
|
|||
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)
|
||||
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
|
||||
|
||||
txt := "ADD VM " + name
|
||||
gw.Name = txt
|
||||
gw = gui.InitGuiWindow(gw)
|
||||
box := gui.HardBox(gw, gui.Yaxis, txt)
|
||||
box := gui.InitWindow(gw, txt, gui.Yaxis)
|
||||
if (box == nil) {
|
||||
log.Println("initWindow() FAILED")
|
||||
return
|
||||
}
|
||||
box = gui.HardBox(gw, gui.Xaxis, txt)
|
||||
// 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)
|
||||
|
||||
txt := "VM " + vm.Name
|
||||
gw.Name = txt
|
||||
gw = gui.InitGuiWindow(gw)
|
||||
box := gui.HardBox(gw, gui.Yaxis, txt)
|
||||
// TODO: make this text i18n
|
||||
box := gui.InitWindow(gw, txt, gui.Yaxis)
|
||||
if (box == nil) {
|
||||
log.Println("initWindow() FAILED")
|
||||
return
|
||||
}
|
||||
box = gui.HardBox(gw, gui.Xaxis, txt)
|
||||
|
||||
// Add hostname entry box
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
8d39c04b6af88dddcaa05df2955c390b94f77ea1
|
Loading…
Reference in New Issue