watches for finished setup
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
c82e88d015
commit
1decb6925b
10
gui.go
10
gui.go
|
@ -177,19 +177,15 @@ func statusGrid(n *gui.Node) {
|
||||||
|
|
||||||
gridP.NewLabel("DNS API")
|
gridP.NewLabel("DNS API")
|
||||||
me.DnsAPIstatus = gridP.NewLabel("unknown")
|
me.DnsAPIstatus = gridP.NewLabel("unknown")
|
||||||
var apiButton *gui.Node
|
me.apiButton = gridP.NewButton("unknown wit.com", func () {
|
||||||
apiButton = gridP.NewButton("unknown wit.com", func () {
|
|
||||||
log.Log(CHANGE, "WHAT API ARE YOU USING?")
|
log.Log(CHANGE, "WHAT API ARE YOU USING?")
|
||||||
provider := me.statusDNS.GetDNSapi()
|
provider := me.statusDNS.GetDNSapi()
|
||||||
apiButton.SetText(provider + " wit.com")
|
|
||||||
if provider == "cloudflare" {
|
if provider == "cloudflare" {
|
||||||
me.DnsAPIstatus.Set("WORKING")
|
|
||||||
return
|
|
||||||
|
|
||||||
if me.witcom != nil {
|
if me.witcom != nil {
|
||||||
me.witcom.Toggle()
|
me.witcom.Toggle()
|
||||||
|
} else {
|
||||||
|
me.witcom = cloudflare.CreateRR(me.myGui, "wit.com", "3777302ac4a78cd7fa4f6d3f72086d06")
|
||||||
}
|
}
|
||||||
me.witcom = cloudflare.CreateRR(me.myGui, "wit.com", "3777302ac4a78cd7fa4f6d3f72086d06")
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
24
main.go
24
main.go
|
@ -95,6 +95,7 @@ func main() {
|
||||||
if provider != lastProvider {
|
if provider != lastProvider {
|
||||||
log.Log(CHANGE, "Your DNS API provider appears to have changed to", provider)
|
log.Log(CHANGE, "Your DNS API provider appears to have changed to", provider)
|
||||||
lastProvider = provider
|
lastProvider = provider
|
||||||
|
me.apiButton.SetText(provider + " wit.com")
|
||||||
}
|
}
|
||||||
if provider == "cloudflare" {
|
if provider == "cloudflare" {
|
||||||
me.DnsAPIstatus.Set("WORKING")
|
me.DnsAPIstatus.Set("WORKING")
|
||||||
|
@ -102,7 +103,7 @@ func main() {
|
||||||
})
|
})
|
||||||
|
|
||||||
// probes the OS network settings
|
// probes the OS network settings
|
||||||
myTicker(500 * time.Millisecond, "me.statusOS,Update()", func() {
|
go myTicker(500 * time.Millisecond, "me.statusOS,Update()", func() {
|
||||||
duration := timeFunction( func() {
|
duration := timeFunction( func() {
|
||||||
me.statusOS.Update()
|
me.statusOS.Update()
|
||||||
|
|
||||||
|
@ -124,6 +125,27 @@ func main() {
|
||||||
s := fmt.Sprint(duration)
|
s := fmt.Sprint(duration)
|
||||||
me.statusOS.SetSpeedActual(s)
|
me.statusOS.SetSpeedActual(s)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// check the four known things to see if they are all WORKING
|
||||||
|
myTicker(3 * time.Second, "MAIN LOOP", func() {
|
||||||
|
if me.hostnameStatus.GetText() != "WORKING" {
|
||||||
|
log.Log(CHANGE, "The hostname is not WORKING yet", me.hostnameStatus.GetText())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if me.statusIPv6.Get() != "WORKING" {
|
||||||
|
log.Log(CHANGE, "IPv6 DNS lookup has not been confirmed yet", me.statusIPv6.Get())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if me.DnsStatus.GetText() != "WORKING" {
|
||||||
|
log.Log(CHANGE, "Your IPv6 DNS settings have not been confirmed yet", me.DnsStatus.GetText())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if me.DnsAPIstatus.GetText() != "WORKING" {
|
||||||
|
log.Log(CHANGE, "The DNS API provider is not yet working", me.DnsAPIstatus.GetText())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Log(CHANGE, "EVERYTHING IS WORKING. YOU HAVE IPv6 BLISS")
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -30,6 +30,7 @@ type Host struct {
|
||||||
hostnameStatus *gui.Node // a summary for the user of where things are
|
hostnameStatus *gui.Node // a summary for the user of where things are
|
||||||
DnsAPIstatus *gui.Node // does your DNS API work?
|
DnsAPIstatus *gui.Node // does your DNS API work?
|
||||||
APIprovider string
|
APIprovider string
|
||||||
|
apiButton *gui.Node // the button you click for the API config page
|
||||||
|
|
||||||
artificialSleep float64 `default:"0.7"` // artificial sleep on startup
|
artificialSleep float64 `default:"0.7"` // artificial sleep on startup
|
||||||
artificialS string `default:"abc"` // artificial sleep on startup
|
artificialS string `default:"abc"` // artificial sleep on startup
|
||||||
|
|
Loading…
Reference in New Issue