SSH: fix files. use os/user Current()

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-11-03 00:47:11 -05:00
parent 86943f3731
commit eef2c0592f
2 changed files with 15 additions and 18 deletions

View File

@ -1,26 +1,23 @@
package main
import ( "log"
import (
// "log"
"git.wit.org/wit/gui"
)
func mainWindow(w *gui.Node) *gui.Node {
if (w == nil) {
gui.Config.Title = "Main Personal GUI Window"
gui.Config.Title = "WIT Debian Control Panel"
gui.Config.Width = 101
gui.Config.Height = 101
w = gui.NewWindow()
}
newTab := w.AddTab("MAIN TAB", nil)
newTab := w.AddTab("Main Tab", nil)
////////////////////////// MAIN ////////////////////////////////
g1 := newTab.AddGroup("Windows")
g1 := newTab.AddGroup("unsorted")
g1.AddButton("resolv.conf", func (*gui.Node) {
log.Println("supposed to make the resolv.conf window")
resolvWindow(nil)
})
g1.AddButton("Generic SSH Window", func (*gui.Node) {
sshGenericWindow(nil)
})
@ -29,9 +26,7 @@ func mainWindow(w *gui.Node) *gui.Node {
updateDNS(nil)
})
g1.AddButton("tabResets()", func (*gui.Node) {
tabResets(w)
})
tabResets(w)
g1.AddButton("www url's", func (*gui.Node) {
windowAddWWW(nil)

View File

@ -1,6 +1,7 @@
package main
import "log"
import "os/user"
import "reflect"
import "git.wit.org/wit/gui"
@ -26,13 +27,15 @@ func sshGenericWindow(w *gui.Node) {
"jcarr",
"hugo")
userNode.SetText("something")
userNode.OnChanged = func () {
username = userNode.GetText()
log.Println("SETTING: username=", username)
userNode.Dump()
// panic("blah")
}
tmp, _ := user.Current()
username = tmp.Username
userNode.SetText(username)
userNode.Dump()
// panic("blah")
@ -40,18 +43,17 @@ func sshGenericWindow(w *gui.Node) {
gNode = tab.AddGroup("homename")
hostNode := gNode.AddComboBox("hostname",
"fire.lab.wit.org",
"www.wit.org",
"bind.wit.org",
"ns1.wit.com",
"ns2.wit.com")
"www",
"mirrors",
"git")
hostNode.SetText("fire")
hostNode.OnChanged = func () {
log.Println("STARTED HOSTNAME")
hostname = hostNode.GetText()
log.Println("ENDED GetText() HOSTNAME")
}
hostname = "mirrors"
hostNode.SetText("mirrors")
////////////// connect /////////////////////////
gNode = tab.AddGroup("connect")