freeze to try to fix things inside libui
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
b75d6abdfb
commit
58b5b2e923
|
@ -11,6 +11,8 @@ import "strconv"
|
|||
import "github.com/golang/protobuf/proto"
|
||||
import pb "git.wit.com/wit/witProtobuf"
|
||||
|
||||
import "git.wit.com/wit/gui"
|
||||
|
||||
var mychannel chan *pb.Event
|
||||
|
||||
func initChannel() {
|
||||
|
@ -22,12 +24,12 @@ func processEvents() {
|
|||
for {
|
||||
message := <-mychannel
|
||||
log.Println("processEvents() on channel recieved a message = ", message)
|
||||
ReadReceivedData(message)
|
||||
addVmsTab()
|
||||
mh := addVmsTab(30)
|
||||
ReadReceivedData(message, mh)
|
||||
}
|
||||
}
|
||||
|
||||
func ReadReceivedData(data *pb.Event) {
|
||||
func ReadReceivedData(data *pb.Event, mh *gui.TableData) {
|
||||
msgItems := data.GetResults()
|
||||
log.Println("ReadReceivedData() Event msgItems=", msgItems)
|
||||
for _, item := range msgItems {
|
||||
|
@ -42,8 +44,16 @@ func ReadReceivedData(data *pb.Event) {
|
|||
|
||||
vms := data.GetVms()
|
||||
log.Println("ReadReceivedData() Event vms=", vms)
|
||||
row := 0
|
||||
for _, item := range vms {
|
||||
mh.Rows[row].Cells[3].Raw = item.Name
|
||||
log.Println(item)
|
||||
row += 1
|
||||
}
|
||||
|
||||
log.Println("ReadReceivedData() mh rows")
|
||||
for row := 0; row < mh.RowCount; row++ {
|
||||
log.Println("\trow=", row)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ type aheader struct {
|
|||
name string
|
||||
}
|
||||
|
||||
func addVmsTab() {
|
||||
func addVmsTab(count int) *gui.TableData {
|
||||
var parts []gui.InputData
|
||||
|
||||
tmp := gui.InputData{}
|
||||
|
@ -231,5 +231,6 @@ func addVmsTab() {
|
|||
tmp.Heading = "Details"
|
||||
parts = append(parts, tmp)
|
||||
|
||||
gui.AddTableTab(cloudtab, 1, "Virtual Machines", 7, parts)
|
||||
mh := gui.AddTableTab(cloudtab, 1, "Virtual Machines", count, parts)
|
||||
return mh
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue