diff --git a/eventChannel.go b/eventChannel.go index 8a83dd0..b2fc095 100644 --- a/eventChannel.go +++ b/eventChannel.go @@ -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) } } diff --git a/infoTabUI.go b/infoTabUI.go index 325838e..4487422 100644 --- a/infoTabUI.go +++ b/infoTabUI.go @@ -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 }