diff --git a/eventChannel.go b/eventChannel.go index 89a91ac..8a83dd0 100644 --- a/eventChannel.go +++ b/eventChannel.go @@ -23,6 +23,7 @@ func processEvents() { message := <-mychannel log.Println("processEvents() on channel recieved a message = ", message) ReadReceivedData(message) + addVmsTab() } } @@ -32,6 +33,18 @@ func ReadReceivedData(data *pb.Event) { for _, item := range msgItems { log.Println(item) } + + nets := data.GetNetworks() + log.Println("ReadReceivedData() Event networks=", nets) + for _, item := range nets { + log.Println(item) + } + + vms := data.GetVms() + log.Println("ReadReceivedData() Event vms=", vms) + for _, item := range vms { + log.Println(item) + } } func handleProtoClient(conn net.Conn) { diff --git a/infoTabUI.go b/infoTabUI.go index d8b756f..2357681 100644 --- a/infoTabUI.go +++ b/infoTabUI.go @@ -154,6 +154,33 @@ func setupCloudUI() { cloudwin.Show() } +func addVmsTab() { + var parts []gui.InputData + + for key, foo := range []string{"BG", "TEXTCOLOR", "TEXT", "BUTTON"} { + log.Println(key, foo) + + var b gui.InputData + b.CellType = foo + b.Heading = fmt.Sprintf("heading%d", key) + parts = append(parts, b) + } + + var b gui.InputData + b.CellType = "TEXTCOLOR" + b.Heading = fmt.Sprintf("cpus") + parts = append(parts, b) + + var c gui.InputData + c.CellType = "TEXTCOLOR" + c.Heading = fmt.Sprintf("memory") + parts = append(parts, c) + + // log.Println("Sleep for 2 seconds, then try to add new tabs") + // time.Sleep(1 * 1000 * 1000 * 1000) + gui.AddTableTab(cloudtab, 1, "Virtual Machines", 7, parts) +} + func addTableTab() { var parts []gui.InputData