almost final code restructure for alpha
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
0101e088c2
commit
3e823f12cb
|
@ -4,7 +4,6 @@ import "log"
|
||||||
|
|
||||||
import "github.com/golang/protobuf/proto"
|
import "github.com/golang/protobuf/proto"
|
||||||
import pb "git.wit.com/wit/witProtobuf"
|
import pb "git.wit.com/wit/witProtobuf"
|
||||||
|
|
||||||
import "git.wit.com/wit/gui"
|
import "git.wit.com/wit/gui"
|
||||||
|
|
||||||
var mychannel chan *pb.Event
|
var mychannel chan *pb.Event
|
||||||
|
@ -53,46 +52,6 @@ func countVMS(data *pb.Event) int {
|
||||||
return len(vms)
|
return len(vms)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func setRowValues(mh *gui.TableData, row int, vm *pb.Event_VM) {
|
|
||||||
defaultTextColor := linuxTextBlue
|
|
||||||
defaultTextYellow := linuxTextYellow
|
|
||||||
defaultTextBlack := linuxTextBlack
|
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
defaultTextColor = windowsTextRed
|
|
||||||
defaultTextBlack = windowsTextBlack
|
|
||||||
}
|
|
||||||
// if (row % 2) == 1 {
|
|
||||||
if (row == 1) {
|
|
||||||
mh.Rows[row].HumanData[0].Color = color.RGBA{100, 100, 100, 142} // makes the background of each other row grey
|
|
||||||
} else if (row == 2) {
|
|
||||||
mh.Rows[row].HumanData[0].Color = color.RGBA{0, 0, 0, 0} // makes the background of each other row grey
|
|
||||||
} else if (row == 3) {
|
|
||||||
mh.Rows[row].HumanData[0].Color = color.RGBA{255, 255, 255, 255} // makes the background of each other row grey
|
|
||||||
} else if (row == 4) {
|
|
||||||
mh.Rows[row].HumanData[0].Color = color.RGBA{255, 255, 255, 0} // makes the background of each other row grey
|
|
||||||
} else if (row == 5) {
|
|
||||||
mh.Rows[row].HumanData[0].Color = color.RGBA{55, 55, 55, 255} // makes the background of each other row grey
|
|
||||||
} else if (row < 10) {
|
|
||||||
mh.Rows[row].HumanData[0].Color = linuxBgMauve
|
|
||||||
} else {
|
|
||||||
mh.Rows[row].HumanData[0].Color = color.RGBA{250, 250, 250, 250}
|
|
||||||
}
|
|
||||||
mh.Rows[row].HumanData[1].Text = vm.Name
|
|
||||||
mh.Rows[row].HumanData[1].Color = defaultTextColor
|
|
||||||
mh.Rows[row].HumanData[2].Text = vm.Hostname
|
|
||||||
mh.Rows[row].HumanData[2].Color = defaultTextYellow
|
|
||||||
mh.Rows[row].HumanData[3].Text = fmt.Sprintf("%d",vm.Cpus)
|
|
||||||
mh.Rows[row].HumanData[3].Color = defaultTextColor
|
|
||||||
mh.Rows[row].HumanData[4].Text = fmt.Sprintf("%d",vm.Memory)
|
|
||||||
mh.Rows[row].HumanData[4].Color = defaultTextBlack
|
|
||||||
mh.Rows[row].HumanData[5].Text = fmt.Sprintf("%d",vm.Disk)
|
|
||||||
mh.Rows[row].HumanData[5].Color = defaultTextBlack
|
|
||||||
mh.Rows[row].HumanData[6].Text = fmt.Sprintf("Details %s",vm.Name)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *gui.GuiWindow) {
|
func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *gui.GuiWindow) {
|
||||||
msgItems := data.GetResults()
|
msgItems := data.GetResults()
|
||||||
log.Println("ReadReceivedData() Event msgItems=", msgItems)
|
log.Println("ReadReceivedData() Event msgItems=", msgItems)
|
||||||
|
@ -116,8 +75,8 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *gui.GuiWindow)
|
||||||
newGuiButton.Action = "SHOW VM"
|
newGuiButton.Action = "SHOW VM"
|
||||||
newGuiButton.VM = vm // set the button to this VM
|
newGuiButton.VM = vm // set the button to this VM
|
||||||
newGuiButton.Account = data.Account
|
newGuiButton.Account = data.Account
|
||||||
newGuiButton.W = window.UiWindow
|
// newGuiButton.W = window.UiWindow
|
||||||
newGuiButton.T = window.UiTab
|
// newGuiButton.T = window.UiTab
|
||||||
newGuiButton.Box = mh.Box
|
newGuiButton.Box = mh.Box
|
||||||
gui.Data.AllButtons = append(gui.Data.AllButtons, &newGuiButton)
|
gui.Data.AllButtons = append(gui.Data.AllButtons, &newGuiButton)
|
||||||
mh.Rows[row].HumanData[6].Button = &newGuiButton
|
mh.Rows[row].HumanData[6].Button = &newGuiButton
|
||||||
|
|
Loading…
Reference in New Issue