Working display

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-12 22:05:56 -07:00
parent b0d88b2227
commit 66924bb35f
2 changed files with 23 additions and 5 deletions

View File

@ -53,11 +53,22 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData) {
vms := data.GetVms()
log.Println("ReadReceivedData() Event vms=", vms)
for row, item := range vms {
mh.Rows[row].Human[1].Text = ui.TableString(item.Name)
mh.Rows[row].Human[2].Text = ui.TableString(item.Hostname)
mh.Rows[row].Human[3].Text = ui.TableString(fmt.Sprintf("%d",item.Cpus))
mh.Rows[row].Human[4].Text = ui.TableString(fmt.Sprintf("%d",item.Memory))
mh.Rows[row].Human[5].Text = ui.TableString(fmt.Sprintf("%d",item.Disk))
if (row % 2) == 1 {
mh.Rows[row].Human[0].Color = ui.TableColor{0, 0, 0, .04}
} else {
mh.Rows[row].Human[0].Color = ui.TableColor{0, 0, 0, 0}
}
mh.Rows[row].Human[1].Text = ui.TableString(item.Name)
mh.Rows[row].Human[1].Color = ui.TableColor{0, 0, 0, 0}
mh.Rows[row].Human[2].Text = ui.TableString(item.Hostname)
mh.Rows[row].Human[2].Color = ui.TableColor{0, 0, 0, 0}
mh.Rows[row].Human[3].Text = ui.TableString(fmt.Sprintf("%d",item.Cpus))
mh.Rows[row].Human[3].Color = ui.TableColor{0, 0, 0, 0}
mh.Rows[row].Human[4].Text = ui.TableString(fmt.Sprintf("%d",item.Memory))
mh.Rows[row].Human[4].Color = ui.TableColor{0, 0, 0, 0}
mh.Rows[row].Human[5].Text = ui.TableString(fmt.Sprintf("%d",item.Disk))
mh.Rows[row].Human[5].Color = ui.TableColor{0, 0, 0, 0}
mh.Rows[row].Human[6].Text = ui.TableString(fmt.Sprintf("Details %s",item.Name))
log.Println("\titem=", item)
log.Println("\titem.Name=", item.Name)

View File

@ -30,6 +30,13 @@ func makeCloudInfoBox() ui.Control {
vbox.Append(ui.NewColorButton(), false)
addXbutton := ui.NewButton("Show bmath's Account")
addXbutton.OnClicked(func(*ui.Button) {
log.Println("gorillaSendProtobuf()")
gorillaSendProtobuf()
})
vbox.Append(addXbutton, false)
vbox.Append(ui.NewLabel("Debugging:"), false)
// ATTEMPT TO ADD THE TABLE HERE