fix the table display. can have more than one now?
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
4df4f2bfd9
commit
ebfab08357
|
@ -69,6 +69,7 @@ func mainMouseClick(b *gui.GuiButton) {
|
||||||
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
|
log.Println("\tmainMouseClick() values.Accounts =", values.Accounts)
|
||||||
log.Println("\tmainMouseClick() values.Name = ", values.Name)
|
log.Println("\tmainMouseClick() values.Name = ", values.Name)
|
||||||
|
|
||||||
|
/*
|
||||||
if (values.Action == "QUIT") {
|
if (values.Action == "QUIT") {
|
||||||
onExit(nil)
|
onExit(nil)
|
||||||
} else if (values.Action == "CREATE") {
|
} else if (values.Action == "CREATE") {
|
||||||
|
@ -77,6 +78,7 @@ func mainMouseClick(b *gui.GuiButton) {
|
||||||
} else if (values.Action == "SHOW") {
|
} else if (values.Action == "SHOW") {
|
||||||
showAccountClick(b)
|
showAccountClick(b)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
log.Println("mainMouseClick() BACK IN CONTROL PANEL CODE")
|
log.Println("mainMouseClick() BACK IN CONTROL PANEL CODE")
|
||||||
log.Println("mainMouseClick() FAILED TO FIND values.Action =", values.Action)
|
log.Println("mainMouseClick() FAILED TO FIND values.Action =", values.Action)
|
||||||
log.Println("mainMouseClick() END")
|
log.Println("mainMouseClick() END")
|
||||||
|
@ -97,8 +99,16 @@ func showAccountClick(b *gui.GuiButton) {
|
||||||
log.Println("\tshowAccountClick() values.Accounts =", values.Accounts)
|
log.Println("\tshowAccountClick() values.Accounts =", values.Accounts)
|
||||||
log.Println("\tshowAccountClick() values.Name = ", values.Name)
|
log.Println("\tshowAccountClick() values.Name = ", values.Name)
|
||||||
|
|
||||||
|
name := "Virtual Machines (" + values.Account.Nick + ")"
|
||||||
gw := b.Box.Window
|
gw := b.Box.Window
|
||||||
|
|
||||||
|
// TODO: make this text i18n
|
||||||
|
box := gui.InitWindow(gw, name, gui.Yaxis)
|
||||||
|
if (box == nil) {
|
||||||
|
log.Println("gui.InitWindow() FAILED")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
event := pb.MakeGetEvent()
|
event := pb.MakeGetEvent()
|
||||||
event.Account = values.Account
|
event.Account = values.Account
|
||||||
websocketSendProtobuf(event)
|
websocketSendProtobuf(event)
|
||||||
|
@ -119,9 +129,9 @@ func showAccountClick(b *gui.GuiButton) {
|
||||||
log.Println("\tSHOW VMS count =", count)
|
log.Println("\tSHOW VMS count =", count)
|
||||||
// TODO: make sure login worked & the account really has zero VMs
|
// TODO: make sure login worked & the account really has zero VMs
|
||||||
// if (count != 0) {
|
// if (count != 0) {
|
||||||
name := "Virtual Machines (" + values.Account.Nick + ")"
|
mh := addVmsTab(box, name, count, values.Account)
|
||||||
mh := addVmsTab(gw, name, count, values.Account)
|
// ReadReceivedData(currentMessage, mh, b.Box)
|
||||||
ReadReceivedData(currentMessage, mh, b.Box)
|
ReadReceivedData(currentMessage, mh, box)
|
||||||
// }
|
// }
|
||||||
currentMessage = nil
|
currentMessage = nil
|
||||||
State = "done"
|
State = "done"
|
||||||
|
|
|
@ -15,7 +15,8 @@ import pb "git.wit.com/wit/witProtobuf"
|
||||||
// which could be anything since TEXTCOLOR, TEXT, BG, etc
|
// which could be anything since TEXTCOLOR, TEXT, BG, etc
|
||||||
// fields use between 1 and 3 values internally
|
// fields use between 1 and 3 values internally
|
||||||
//
|
//
|
||||||
func addVmsTab(gw *gui.GuiWindow, name string, count int, a *pb.Account) *gui.TableData {
|
// func addVmsTab(gw *gui.GuiWindow, name string, count int, a *pb.Account) *gui.TableData {
|
||||||
|
func addVmsTab(box *gui.GuiBox, name string, count int, a *pb.Account) *gui.TableData {
|
||||||
var parts []gui.TableColumnData
|
var parts []gui.TableColumnData
|
||||||
|
|
||||||
human := 0
|
human := 0
|
||||||
|
@ -69,7 +70,8 @@ func addVmsTab(gw *gui.GuiWindow, name string, count int, a *pb.Account) *gui.Ta
|
||||||
parts = append(parts, tmp)
|
parts = append(parts, tmp)
|
||||||
human += 1
|
human += 1
|
||||||
|
|
||||||
mh := gui.AddTableTab(gw, name, count, parts)
|
// mh := gui.AddTableTab(gw, name, count, parts)
|
||||||
|
mh := gui.AddTableBox(box, name, count, parts)
|
||||||
makeButton(mh.Box, a, nil, "Add Virtual Machine", "JUNK", createAddVmBox)
|
makeButton(mh.Box, a, nil, "Add Virtual Machine", "JUNK", createAddVmBox)
|
||||||
|
|
||||||
makeButton(mh.Box, a, nil, "Login", "JUNK", login)
|
makeButton(mh.Box, a, nil, "Login", "JUNK", login)
|
||||||
|
|
Loading…
Reference in New Issue