2021-11-02 23:44:28 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "log"
|
2024-01-05 09:58:05 -06:00
|
|
|
import "go.wit.com/gui/gui"
|
2021-11-02 23:44:28 -05:00
|
|
|
|
|
|
|
func windowAddWWW(w *gui.Node) {
|
|
|
|
if (w == nil) {
|
|
|
|
gui.Config.Title = "webpages"
|
|
|
|
gui.Config.Width = 102
|
|
|
|
gui.Config.Height = 102
|
|
|
|
w = gui.NewWindow()
|
|
|
|
}
|
|
|
|
|
2021-11-03 01:02:05 -05:00
|
|
|
tab := w.AddTab("http", nil)
|
2021-11-02 23:44:28 -05:00
|
|
|
|
|
|
|
////////////// connect /////////////////////////
|
|
|
|
gNode := tab.AddGroup("www")
|
2021-11-03 01:02:05 -05:00
|
|
|
firefoxButton(gNode, "git", "https://git.wit.org/")
|
|
|
|
firefoxButton(gNode, "mirrors", "https://mirrors.wit.org/")
|
|
|
|
firefoxButton(gNode, "IPv6-Only ping", "http://ping.wit.org/")
|
|
|
|
firefoxButton(gNode, "SyncThing", "http://localhost:8384/")
|
|
|
|
firefoxButton(gNode, "pprof this GO app", "http://localhost:6060/debug/pprof/")
|
2021-11-02 23:44:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func firefoxButton (n *gui.Node, name string, url string) {
|
|
|
|
n.AddButton(name, func (*gui.Node) {
|
|
|
|
log.Println("button clicked: trying to open url")
|
|
|
|
var tmp []string
|
|
|
|
tmp = append(tmp, "nohup")
|
|
|
|
tmp = append(tmp, firefox...)
|
|
|
|
tmp = append(tmp, url)
|
|
|
|
go runCommand(tmp)
|
|
|
|
})
|
|
|
|
// bNode.Dump()
|
|
|
|
}
|