misc cleanups

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-05-22 16:23:55 -05:00
parent 5d7004ad92
commit dbd81e9462
4 changed files with 11 additions and 24 deletions

View File

@ -3,7 +3,7 @@ package main
import (
"git.wit.org/wit/gui"
"git.wit.org/jcarr/dnssecsocket"
// "git.wit.org/jcarr/dnssecsocket"
)
type LogOptions struct {
@ -17,10 +17,10 @@ type LogOptions struct {
var args struct {
LogOptions
dnssecsocket.Args
// dnssecsocket.Args
gui.GuiArgs
}
func parsedown () {
dnssecsocket.Parse(args.VerboseDnssec)
// dnssecsocket.Parse(args.VerboseDnssec)
}

6
gui.go
View File

@ -17,7 +17,7 @@ import (
func setupControlPanelWindow() {
// me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
me.window = myGui.NewWindow("DNS and IPv6 Control Panel").Standard()
me.window.Dump(true)
me.window.Dump()
sleep(1)
addDNSTab("DNS")
@ -100,12 +100,14 @@ func addDNSTab(title string) {
nsupdateGroup(me.tab)
/*
tmp := me.tab.NewGroup("output")
me.output = tmp.NewTextbox("some output")
me.output.Custom = func() {
s := me.output.GetText()
log("output text =", s)
}
*/
}
func myDefaultExit(n *gui.Node) {
@ -149,6 +151,7 @@ func nsupdateGroup(w *gui.Node) {
})
}
/*
var outJunk string
func output(s string, a bool) {
if (a) {
@ -159,6 +162,7 @@ func output(s string, a bool) {
me.output.SetText(outJunk)
log(outJunk)
}
*/
func updateDNS() {
var aaaa []string

22
main.go
View File

@ -25,36 +25,23 @@ func main() {
me.ifmap = make(map[int]*IFtype)
me.dnsTTL = 5 // recheck DNS is working every 2 minutes // TODO: watch rx packets?
log()
log(true, "this is true")
log(false, "this is false")
sleep(.4)
sleep(.3)
sleep(.2)
sleep("done scanning net")
// Example_listLink()
log("Toolkit = ", args.Toolkit)
for i, t := range args.Toolkit {
log("Toolkit = ", args.GuiToolkit)
for i, t := range args.GuiToolkit {
log("trying to load plugin", i, t)
myGui.LoadToolkit(t)
}
// will set all debugging flags
gui.SetDebug(true)
// gui.SetDebug(true)
myGui = gui.New().LoadToolkit("gocui")
sleep(1)
setupControlPanelWindow()
sleep(1)
// sleep(1)
if (args.GuiDebug) {
gui.DebugWindow()
}
gui.ShowDebugValues()
go gui.Watchdog()
// forever monitor for network and dns changes
checkNetworkChanges()
@ -102,10 +89,7 @@ func dnsTTL() {
if (me.changed) {
stamp := time.Now().Format("2006/01/02 15:04:05")
s := stamp + " Network things changed"
log(logError, "Network things changed on", stamp)
updateDNS()
me.output.SetText(s)
}
}

View File

@ -22,7 +22,6 @@ type Host struct {
window *gui.Node // the main window
tab *gui.Node // the main dns tab
notes *gui.Node // using this to put notes here
output *gui.Node // Textbox for dumping output
uid *gui.Node // user
fqdn *gui.Node // display the full hostname
IPv4 *gui.Node // show valid IPv4 addresses