new gui api changes
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
9aeed44eea
commit
7e358767ea
|
@ -19,10 +19,10 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/log"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type digStatus struct {
|
type digStatus struct {
|
||||||
|
|
2
dns.go
2
dns.go
|
@ -8,8 +8,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/log"
|
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -7,8 +7,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
1
gui.go
1
gui.go
|
@ -22,6 +22,7 @@ func setupControlPanelWindow() {
|
||||||
// setup the main tab
|
// setup the main tab
|
||||||
mainWindow("DNS and IPv6 Control Panel")
|
mainWindow("DNS and IPv6 Control Panel")
|
||||||
debugTab("Debug")
|
debugTab("Debug")
|
||||||
|
me.window.Show()
|
||||||
}
|
}
|
||||||
|
|
||||||
func debugTab(title string) {
|
func debugTab(title string) {
|
||||||
|
|
|
@ -14,8 +14,8 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
33
main.go
33
main.go
|
@ -10,8 +10,8 @@ import (
|
||||||
"embed"
|
"embed"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/debugger"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
"go.wit.com/lib/debugger"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/linuxstatus"
|
"go.wit.com/lib/gui/linuxstatus"
|
||||||
|
@ -45,18 +45,21 @@ func main() {
|
||||||
me.myGui.InitEmbed(resToolkit)
|
me.myGui.InitEmbed(resToolkit)
|
||||||
me.myGui.Default()
|
me.myGui.Default()
|
||||||
|
|
||||||
log.Sleep(me.artificialSleep)
|
// log.Sleep(me.artificialSleep)
|
||||||
setupControlPanelWindow()
|
// setupControlPanelWindow()
|
||||||
|
// setup the main tab
|
||||||
|
mainWindow("DNS and IPv6 Control Panel")
|
||||||
|
debugTab("Debug")
|
||||||
|
me.window.Show()
|
||||||
|
log.Sleep(1)
|
||||||
|
me.window.Toggle()
|
||||||
|
log.Sleep(1)
|
||||||
|
me.window.Toggle()
|
||||||
|
|
||||||
me.digStatus = NewDigStatusWindow(me.myGui)
|
me.digStatus = NewDigStatusWindow(me.myGui)
|
||||||
me.statusDNS = NewHostnameStatusWindow(me.myGui)
|
me.statusDNS = NewHostnameStatusWindow(me.myGui)
|
||||||
|
|
||||||
me.statusOS = linuxstatus.New()
|
me.statusOS = linuxstatus.NewLinuxStatus(me.myGui)
|
||||||
me.statusOS.SetParent(me.myGui)
|
|
||||||
me.statusOS.InitWindow()
|
|
||||||
me.statusOS.Make()
|
|
||||||
me.statusOS.Draw()
|
|
||||||
me.statusOS.Draw2()
|
|
||||||
|
|
||||||
if debugger.ArgDebug() {
|
if debugger.ArgDebug() {
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -64,10 +67,6 @@ func main() {
|
||||||
debugger.DebugWindow()
|
debugger.DebugWindow()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
me.window.Toggle()
|
|
||||||
log.Sleep(1)
|
|
||||||
me.window.Toggle()
|
|
||||||
log.Sleep(1)
|
|
||||||
|
|
||||||
log.Sleep(me.artificialSleep)
|
log.Sleep(me.artificialSleep)
|
||||||
|
|
||||||
|
@ -80,12 +79,12 @@ func main() {
|
||||||
if me.digStatus.IPv6() {
|
if me.digStatus.IPv6() {
|
||||||
if current != "WORKING" {
|
if current != "WORKING" {
|
||||||
log.Log(CHANGE, "IPv6 resolution is WORKING")
|
log.Log(CHANGE, "IPv6 resolution is WORKING")
|
||||||
me.statusIPv6.SetLabel("WORKING")
|
me.statusIPv6.SetText("WORKING")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if current != "Need VPN" {
|
if current != "Need VPN" {
|
||||||
log.Log(CHANGE, "IPv6 resolution seems to have broken")
|
log.Log(CHANGE, "IPv6 resolution seems to have broken")
|
||||||
me.statusIPv6.SetLabel("Need VPN")
|
me.statusIPv6.SetText("Need VPN")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +106,7 @@ func main() {
|
||||||
me.apiButton.SetText(provider + " wit.com")
|
me.apiButton.SetText(provider + " wit.com")
|
||||||
}
|
}
|
||||||
if provider == "cloudflare" {
|
if provider == "cloudflare" {
|
||||||
me.DnsAPIstatus.SetLabel("WORKING")
|
me.DnsAPIstatus.SetText("WORKING")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -118,7 +117,7 @@ func main() {
|
||||||
|
|
||||||
if me.statusOS.ValidHostname() {
|
if me.statusOS.ValidHostname() {
|
||||||
if me.hostnameStatus.String() != "WORKING" {
|
if me.hostnameStatus.String() != "WORKING" {
|
||||||
me.hostnameStatus.SetLabel("WORKING")
|
me.hostnameStatus.SetText("WORKING")
|
||||||
me.changed = true
|
me.changed = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
"go.wit.com/lib/gadgets"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/linuxstatus"
|
"go.wit.com/lib/gui/linuxstatus"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue