parent
5645231c49
commit
c16bb5b088
6
Makefile
6
Makefile
|
@ -1,5 +1,5 @@
|
||||||
run: build
|
run: build
|
||||||
./control-panel-dns
|
./control-panel-dns >/tmp/witgui.log.stderr 2>&1
|
||||||
|
|
||||||
install:
|
install:
|
||||||
go install -v go.wit.com/control-panel-dns@latest
|
go install -v go.wit.com/control-panel-dns@latest
|
||||||
|
@ -91,3 +91,7 @@ sudo-cp:
|
||||||
|
|
||||||
go-get:
|
go-get:
|
||||||
go install -v check.lab.wit.org/gui
|
go install -v check.lab.wit.org/gui
|
||||||
|
|
||||||
|
log:
|
||||||
|
reset
|
||||||
|
tail -f /tmp/witgui.* /tmp/guilogfile
|
||||||
|
|
1
args.go
1
args.go
|
@ -12,6 +12,7 @@ type LogOptions struct {
|
||||||
VerboseDNS bool `arg:"--verbose-dns" help:"debug your dns settings"`
|
VerboseDNS bool `arg:"--verbose-dns" help:"debug your dns settings"`
|
||||||
LogFile string `help:"write all output to a file"`
|
LogFile string `help:"write all output to a file"`
|
||||||
// User string `arg:"env:USER"`
|
// User string `arg:"env:USER"`
|
||||||
|
Display string `arg:"env:DISPLAY"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var args struct {
|
var args struct {
|
||||||
|
|
15
gui.go
15
gui.go
|
@ -2,6 +2,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -12,8 +13,8 @@ import (
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This initializes the first window
|
// This setups up the dns control panel window
|
||||||
func initGUI() {
|
func setupControlPanelWindow() {
|
||||||
me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
|
me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
|
||||||
me.window.Dump(true)
|
me.window.Dump(true)
|
||||||
|
|
||||||
|
@ -36,6 +37,14 @@ func addDNSTab(title string) {
|
||||||
g2.NewButton("gui.DebugWindow()", func () {
|
g2.NewButton("gui.DebugWindow()", func () {
|
||||||
gui.DebugWindow()
|
gui.DebugWindow()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
g2.NewButton("Load 'gocui'", func () {
|
||||||
|
// this set the xterm and mate-terminal window title. maybe works generally?
|
||||||
|
fmt.Println("\033]0;" + title + "blah \007")
|
||||||
|
gui.StartS("gocui")
|
||||||
|
gui.Redraw("gocui")
|
||||||
|
})
|
||||||
|
|
||||||
g2.NewButton("Network Interfaces", func () {
|
g2.NewButton("Network Interfaces", func () {
|
||||||
for i, t := range me.ifmap {
|
for i, t := range me.ifmap {
|
||||||
log("name =", t.iface.Name)
|
log("name =", t.iface.Name)
|
||||||
|
@ -106,7 +115,7 @@ func myDefaultExit(n *gui.Node) {
|
||||||
func nsupdateGroup(w *gui.Node) {
|
func nsupdateGroup(w *gui.Node) {
|
||||||
g := w.NewGroup("dns update")
|
g := w.NewGroup("dns update")
|
||||||
|
|
||||||
grid := g.NewGrid("fucknuts", 2, 2)
|
grid := g.NewGrid("gridnuts", 2, 2)
|
||||||
|
|
||||||
grid.SetNext(1,1)
|
grid.SetNext(1,1)
|
||||||
grid.NewLabel("hostname =")
|
grid.NewLabel("hostname =")
|
||||||
|
|
5
main.go
5
main.go
|
@ -42,7 +42,10 @@ func main() {
|
||||||
// myGui = gui.Main(initGUI)
|
// myGui = gui.Main(initGUI)
|
||||||
myGui = gui.Start()
|
myGui = gui.Start()
|
||||||
sleep(1)
|
sleep(1)
|
||||||
initGUI()
|
setupControlPanelWindow()
|
||||||
|
sleep(1)
|
||||||
|
myGui.LoadPlugin("gocui")
|
||||||
|
// gui.Redraw("gocui")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
checkNetworkChanges()
|
checkNetworkChanges()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue