simplify the login process

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-30 12:44:16 -07:00
parent a77ea2cfc6
commit 8e88ae634f
2 changed files with 17 additions and 19 deletions

View File

@ -137,7 +137,7 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *ui.Window, tab
newGuiButton.Account = data.Account
newGuiButton.W = window
newGuiButton.T = tab
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].VM = vm

34
main.go
View File

@ -259,26 +259,24 @@ func mainMouseClick(b *gui.GuiButton) {
log.Println("\tFINISHED FULL STACK DUMP")
} else if (b.Action == "ADD") {
log.Println("\tSHOULD ADD ACCOUNT HERE")
if (gui.Data.EntryNick != nil) {
nick := gui.Data.EntryNick.Text()
username := gui.Data.EntryUser.Text()
password := gui.Data.EntryPass.Text()
log.Println("\tEntryNick =", nick)
log.Println("\tEntryName =", username)
log.Println("\tEntryPass =", password)
acc := new(pb.Account)
acc.Nick = nick
acc.Username = username
acc.Password = password
config.Accounts = append(config.Accounts, acc)
}
if (gui.Data.State == "main") {
gui.ShowMainTab(wm)
gui.Data.State = "done"
subdomain := gui.GetText(b.Box, "SUBDOMAIN")
if (subdomain == "") {
gui.ErrorWindow(wm, "Blank Name", "You must have a valid subdomain")
return
}
log.Println("\tsubdomain =", subdomain)
acc := new(pb.Account)
acc.Nick = subdomain
acc.Domain = subdomain
acc.Username = "jcarr@wit.com"
acc.Email = "jcarr@wit.com"
acc.Password = "badpass"
acc.URL = "http://stackapi-api1.stackapi.customers.dev.wit.com:4000/"
config.Accounts = append(config.Accounts, acc)
gui.ShowMainTab(wm)
gui.Data.State = "done"
} else if (b.Action == "LOGIN") {
log.Println("\tTRIGGER LOGIN ACCOUNT")
gui.Data.State = "SEND LOGIN"