almost starting all the engines on startup

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-05 00:30:58 -06:00
parent fdcd51d211
commit ee6c4e2a72
2 changed files with 14 additions and 10 deletions

View File

@ -35,10 +35,9 @@ type digStatus struct {
statusIPv6 string statusIPv6 string
parent *gui.Node parent *gui.Node
window *gui.Node window *gadgets.BasicWindow
group *gui.Node group *gui.Node
grid *gui.Node grid *gui.Node
box *gui.Node
summary *gui.Node summary *gui.Node
status *gadgets.OneLiner status *gadgets.OneLiner
@ -93,15 +92,12 @@ func NewDigStatusWindow(p *gui.Node) *digStatus {
ds.ready = false ds.ready = false
ds.hidden = true ds.hidden = true
ds.window = p.NewWindow("DNS Resolver Status") ds.window = gadgets.NewBasicWindow(p, "DNS Resolver Status")
ds.window.Custom = func () {
ds.hidden = true ds.window.Hide()
ds.window.Hide()
}
ds.box = ds.window.NewBox("hBox", true)
// summary of the current state of things // summary of the current state of things
ds.summary = ds.box.NewGroup("Summary") ds.summary = ds.window.Box().NewGroup("Summary")
g := ds.summary.NewGrid("LookupStatus", 2, 2) g := ds.summary.NewGrid("LookupStatus", 2, 2)
g.Pad() g.Pad()
@ -112,7 +108,7 @@ func NewDigStatusWindow(p *gui.Node) *digStatus {
ds.speedActual = gadgets.NewOneLiner(g, "actual").Set("unknown") ds.speedActual = gadgets.NewOneLiner(g, "actual").Set("unknown")
// make the area to store the raw details // make the area to store the raw details
ds.details = ds.box.NewGroup("Details") ds.details = ds.window.Box().NewGroup("Details")
ds.dsLocalhost = NewDnsStatus(ds.details, "(localhost)", "127.0.0.1:53", "go.wit.com") ds.dsLocalhost = NewDnsStatus(ds.details, "(localhost)", "127.0.0.1:53", "go.wit.com")
ds.dsLocalNetwork = NewDnsStatus(ds.details, "(Local Network)", "172.22.0.1:53", "go.wit.com") ds.dsLocalNetwork = NewDnsStatus(ds.details, "(Local Network)", "172.22.0.1:53", "go.wit.com")
ds.dsCloudflare = NewDnsStatus(ds.details, "(cloudflare)", "1.1.1.1:53", "go.wit.com") ds.dsCloudflare = NewDnsStatus(ds.details, "(cloudflare)", "1.1.1.1:53", "go.wit.com")

8
gui.go
View File

@ -233,6 +233,9 @@ func mainWindow(title string) {
}) })
me.fix.Disable() me.fix.Disable()
me.digStatus = NewDigStatusWindow(me.myGui)
/*
me.digStatusButton = me.mainStatus.NewButton("Resolver Status", func () { me.digStatusButton = me.mainStatus.NewButton("Resolver Status", func () {
if (me.digStatus == nil) { if (me.digStatus == nil) {
log.Info("drawing the digStatus window START") log.Info("drawing the digStatus window START")
@ -251,6 +254,7 @@ func mainWindow(title string) {
me.digStatus.Hide() me.digStatus.Hide()
} }
}) })
*/
me.hostnameStatusButton = me.mainStatus.NewButton("Show hostname DNS Status", func () { me.hostnameStatusButton = me.mainStatus.NewButton("Show hostname DNS Status", func () {
if (me.hostnameStatus == nil) { if (me.hostnameStatus == nil) {
me.hostnameStatus = NewHostnameStatusWindow(me.myGui) me.hostnameStatus = NewHostnameStatusWindow(me.myGui)
@ -283,6 +287,10 @@ func mainWindow(title string) {
gr.NewButton("DNS Debug", func () { gr.NewButton("DNS Debug", func () {
me.debug.Toggle() me.debug.Toggle()
}) })
gr.NewButton("Resolver Status", func () {
if ! me.digStatus.Ready() {return}
me.digStatus.window.Toggle()
})
} }
func statusGrid(n *gui.Node) { func statusGrid(n *gui.Node) {