CLEAN: more code cleanup
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
eef2c0592f
commit
0dccc86000
|
@ -28,16 +28,9 @@ func mainWindow(w *gui.Node) *gui.Node {
|
||||||
|
|
||||||
tabResets(w)
|
tabResets(w)
|
||||||
|
|
||||||
g1.AddButton("www url's", func (*gui.Node) {
|
windowAddWWW(w)
|
||||||
windowAddWWW(nil)
|
|
||||||
})
|
|
||||||
|
|
||||||
////////////////////////// TABS ////////////////////////////////
|
|
||||||
g2 := newTab.AddGroup("Tabs")
|
|
||||||
|
|
||||||
g2.AddButton("GO language debuggging", func (*gui.Node) {
|
|
||||||
golangDebug(w)
|
golangDebug(w)
|
||||||
})
|
|
||||||
|
|
||||||
return newTab
|
return newTab
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
// import "reflect"
|
|
||||||
import "git.wit.org/wit/gui"
|
import "git.wit.org/wit/gui"
|
||||||
|
|
||||||
import "github.com/skratchdot/open-golang/open"
|
|
||||||
|
|
||||||
func windowAddWWW(w *gui.Node) {
|
func windowAddWWW(w *gui.Node) {
|
||||||
if (w == nil) {
|
if (w == nil) {
|
||||||
gui.Config.Title = "webpages"
|
gui.Config.Title = "webpages"
|
||||||
|
@ -14,20 +11,20 @@ func windowAddWWW(w *gui.Node) {
|
||||||
w = gui.NewWindow()
|
w = gui.NewWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
tab := w.AddTab("start www", nil)
|
tab := w.AddTab("http", nil)
|
||||||
|
|
||||||
////////////// connect /////////////////////////
|
////////////// connect /////////////////////////
|
||||||
gNode := tab.AddGroup("www")
|
gNode := tab.AddGroup("www")
|
||||||
urlButton(gNode, "git", "https://git.wit.org/")
|
firefoxButton(gNode, "git", "https://git.wit.org/")
|
||||||
urlButton(gNode, "mirrors", "https://mirrors.wit.org/")
|
firefoxButton(gNode, "mirrors", "https://mirrors.wit.org/")
|
||||||
urlButton(gNode, "ping.wit.com 6", "http://ping.wit.com/")
|
firefoxButton(gNode, "IPv6-Only ping", "http://ping.wit.org/")
|
||||||
urlButton(gNode, "pprof localhost", "http://localhost:6060/debug/pprof/")
|
firefoxButton(gNode, "SyncThing", "http://localhost:8384/")
|
||||||
|
firefoxButton(gNode, "pprof this GO app", "http://localhost:6060/debug/pprof/")
|
||||||
}
|
}
|
||||||
|
|
||||||
func firefoxButton (n *gui.Node, name string, url string) {
|
func firefoxButton (n *gui.Node, name string, url string) {
|
||||||
n.AddButton(name, func (*gui.Node) {
|
n.AddButton(name, func (*gui.Node) {
|
||||||
log.Println("button clicked: trying to open url")
|
log.Println("button clicked: trying to open url")
|
||||||
// cmd := "--new-window http://192.168.100.1/"
|
|
||||||
var tmp []string
|
var tmp []string
|
||||||
tmp = append(tmp, "nohup")
|
tmp = append(tmp, "nohup")
|
||||||
tmp = append(tmp, firefox...)
|
tmp = append(tmp, firefox...)
|
||||||
|
@ -36,15 +33,3 @@ func firefoxButton (n *gui.Node, name string, url string) {
|
||||||
})
|
})
|
||||||
// bNode.Dump()
|
// bNode.Dump()
|
||||||
}
|
}
|
||||||
|
|
||||||
func urlButton (n *gui.Node, name string, url string) {
|
|
||||||
if (useFirefox == true) {
|
|
||||||
firefoxButton(n, name, url)
|
|
||||||
} else {
|
|
||||||
bNode := n.AddButton(name, func (*gui.Node) {
|
|
||||||
log.Println("button clicked: trying to open url =", url)
|
|
||||||
open.Run(url)
|
|
||||||
})
|
|
||||||
bNode.Dump()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue