fix login & vm list + working token
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
61ccb89925
commit
d03ff70b59
|
@ -51,6 +51,7 @@ func gorillaSendProtobuf(msg *pb.Event) {
|
||||||
msg := pb.CreateSampleEvent()
|
msg := pb.CreateSampleEvent()
|
||||||
msg.Name = "test echo over gorilla websocket"
|
msg.Name = "test echo over gorilla websocket"
|
||||||
*/
|
*/
|
||||||
|
log.Println("gorillaSendProtobuf() going to Marshal msg =", msg)
|
||||||
data, _ := proto.Marshal(msg)
|
data, _ := proto.Marshal(msg)
|
||||||
err2 := gorillaConn.WriteMessage(websocket.BinaryMessage, data)
|
err2 := gorillaConn.WriteMessage(websocket.BinaryMessage, data)
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
|
|
18
main.go
18
main.go
|
@ -300,34 +300,40 @@ func watchGUI() {
|
||||||
|
|
||||||
if (gui.Data.State == "SEND WEBSOCKET") {
|
if (gui.Data.State == "SEND WEBSOCKET") {
|
||||||
event := pb.MakeGetEvent()
|
event := pb.MakeGetEvent()
|
||||||
if (gui.Data.Current == nil) {
|
if (gui.Data.Current != nil) {
|
||||||
event.Token = gui.Data.Current.Token
|
event.Token = gui.Data.Current.Token
|
||||||
event.Username = gui.Data.Current.Username
|
event.Username = gui.Data.Current.Username
|
||||||
}
|
}
|
||||||
log.Println("\tTRIGGERING WEBSOCKET pb.MakeGetEvent() event.Token =", event.Token)
|
log.Println("\tTRIGGERING event.Token =", event.Token)
|
||||||
|
log.Println("\tTRIGGERING event.Username =", event.Username)
|
||||||
|
log.Println("\tTRIGGERING event.Email =", event.Email)
|
||||||
|
|
||||||
gorillaSendProtobuf(event)
|
gorillaSendProtobuf(event)
|
||||||
gui.Data.State = "READ PROTOBUF"
|
gui.Data.State = "READ PROTOBUF"
|
||||||
}
|
}
|
||||||
if (gui.Data.State == "SEND LOGIN") {
|
if (gui.Data.State == "SEND LOGIN") {
|
||||||
event := pb.MakeLoginEvent()
|
event := pb.MakeLoginEvent()
|
||||||
if (gui.Data.Current == nil) {
|
if (gui.Data.Current != nil) {
|
||||||
event.Token = gui.Data.Current.Token
|
event.Token = gui.Data.Current.Token
|
||||||
event.Username = gui.Data.Current.Username
|
event.Username = gui.Data.Current.Username
|
||||||
event.Password = gui.Data.Current.Password
|
event.Password = gui.Data.Current.Password
|
||||||
}
|
}
|
||||||
log.Println("\tTRIGGERING LOGIN HERE pb.MakeLoginEvent() event.Token =", event.Token)
|
log.Println("\tTRIGGERING event.Token =", event.Token)
|
||||||
|
log.Println("\tTRIGGERING event.Username =", event.Username)
|
||||||
|
log.Println("\tTRIGGERING event.Email =", event.Email)
|
||||||
gorillaSendProtobuf(event)
|
gorillaSendProtobuf(event)
|
||||||
gui.Data.State = "READ PROTOBUF"
|
gui.Data.State = "READ PROTOBUF"
|
||||||
}
|
}
|
||||||
if (gui.Data.State == "CREATE") {
|
if (gui.Data.State == "CREATE") {
|
||||||
log.Println("\tTRIGGERING CREATE HERE")
|
log.Println("\tTRIGGERING CREATE HERE")
|
||||||
event := pb.MakeAddVmEvent()
|
event := pb.MakeAddVmEvent()
|
||||||
if (gui.Data.Current == nil) {
|
if (gui.Data.Current != nil) {
|
||||||
event.Token = gui.Data.Current.Token
|
event.Token = gui.Data.Current.Token
|
||||||
event.Username = gui.Data.Current.Username
|
event.Username = gui.Data.Current.Username
|
||||||
}
|
}
|
||||||
log.Println("\tTRIGGERING CREATE HERE with event.Token =", event.Token)
|
log.Println("\tTRIGGERING event.Token =", event.Token)
|
||||||
|
log.Println("\tTRIGGERING event.Username =", event.Username)
|
||||||
|
log.Println("\tTRIGGERING event.Email =", event.Email)
|
||||||
|
|
||||||
spew.Dump(event)
|
spew.Dump(event)
|
||||||
gorillaSendProtobuf(event)
|
gorillaSendProtobuf(event)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
{
|
{
|
||||||
"nick": "bmath",
|
"nick": "bmath",
|
||||||
"username": "bmath@wit.com",
|
"username": "bmath@wit.com",
|
||||||
"token": "eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJ4IjoyLCJyIjoiIiwiY3NyZiI6Ik9rR0JWenphV2cxQjVlN0R5YjRXSzIyWCIsImV4cCI6MTU1OTE4NTc1MiwiaXNzIjoid2l0Iiwic3ViIjoiYm1hdGhAd2l0LmNvbSJ9.vdOAXyt3VIovqEIbivgt6upqR8glZv2UdzFcyudzCmGV-msdZWi_9TZaATyQMxEaVD3K6gRunakyOWK0jw4xxeDUbQym86IKMU2UOjp0tN0z72OmH822NmQ8_AgWiKNI",
|
"token": "eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJ4IjoyLCJyIjoiIiwiY3NyZiI6IjZMdlRIeVo0N1UzdEU4MTV5UkVmaERWSCIsImV4cCI6MTU1OTQyNjQ1OSwiaXNzIjoid2l0Iiwic3ViIjoiYm1hdGhAd2l0LmNvbSJ9.OUjebDY_e05Q_X7q2dxsjPAof7qhJLAk8WA9eY8IbNg22M3oARikH-IHLACZkQ-yM6-1dmNYRbWaXGZlKd4J7W1uOb2xFRJMMk_LCNZ83cyVI8ddCkPzvOI_IHUJ7Eus",
|
||||||
"hostname": "hosttest.wit.com",
|
"hostname": "hosttest.wit.com",
|
||||||
"domainname": "test.wit.com"
|
"domainname": "test.wit.com"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue