okay then

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-07 11:23:47 -05:00
parent 5645231c49
commit c16bb5b088
4 changed files with 22 additions and 5 deletions

View File

@ -1,5 +1,5 @@
run: build
./control-panel-dns
./control-panel-dns >/tmp/witgui.log.stderr 2>&1
install:
go install -v go.wit.com/control-panel-dns@latest
@ -91,3 +91,7 @@ sudo-cp:
go-get:
go install -v check.lab.wit.org/gui
log:
reset
tail -f /tmp/witgui.* /tmp/guilogfile

View File

@ -12,6 +12,7 @@ type LogOptions struct {
VerboseDNS bool `arg:"--verbose-dns" help:"debug your dns settings"`
LogFile string `help:"write all output to a file"`
// User string `arg:"env:USER"`
Display string `arg:"env:DISPLAY"`
}
var args struct {

15
gui.go
View File

@ -2,6 +2,7 @@
package main
import (
"fmt"
"os"
"os/user"
"strconv"
@ -12,8 +13,8 @@ import (
"github.com/davecgh/go-spew/spew"
)
// This initializes the first window
func initGUI() {
// This setups up the dns control panel window
func setupControlPanelWindow() {
me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
me.window.Dump(true)
@ -36,6 +37,14 @@ func addDNSTab(title string) {
g2.NewButton("gui.DebugWindow()", func () {
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 () {
for i, t := range me.ifmap {
log("name =", t.iface.Name)
@ -106,7 +115,7 @@ func myDefaultExit(n *gui.Node) {
func nsupdateGroup(w *gui.Node) {
g := w.NewGroup("dns update")
grid := g.NewGrid("fucknuts", 2, 2)
grid := g.NewGrid("gridnuts", 2, 2)
grid.SetNext(1,1)
grid.NewLabel("hostname =")

View File

@ -42,7 +42,10 @@ func main() {
// myGui = gui.Main(initGUI)
myGui = gui.Start()
sleep(1)
initGUI()
setupControlPanelWindow()
sleep(1)
myGui.LoadPlugin("gocui")
// gui.Redraw("gocui")
sleep(1)
checkNetworkChanges()
}