status changes to working if it's working

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-06 21:17:06 -06:00
parent 5e9f1591ca
commit e5319cd50e
3 changed files with 14 additions and 3 deletions

2
fix.go
View File

@ -35,11 +35,11 @@ func fix() bool {
log.Log(CHANGE, "OK You do not have real IPv4 addresses. Nothing to fix here") log.Log(CHANGE, "OK You do not have real IPv4 addresses. Nothing to fix here")
} }
if ! me.statusDNS.IPv6() { if ! me.statusDNS.IPv6() {
log.Log(CHANGE, "IPv6 DNS is broken. Check what is broken here")
if fixIPv6dns() { if fixIPv6dns() {
log.Log(CHANGE, "IPv6 DNS Repair is underway") log.Log(CHANGE, "IPv6 DNS Repair is underway")
return false return false
} }
log.Log(CHANGE, "GOOD IPv6 DNS is working!")
} }
log.Log(CHANGE, "GOOD YOU SHOULD BE IN IPv6 BLISS") log.Log(CHANGE, "GOOD YOU SHOULD BE IN IPv6 BLISS")
return true return true

14
gui.go
View File

@ -151,8 +151,18 @@ func mainWindow(title string) {
me.DnsA = grid.NewLabel("?") me.DnsA = grid.NewLabel("?")
// This is where you figure out what to do next to fix the problems // This is where you figure out what to do next to fix the problems
gr.NewButton("fix", func () { me.fixButton = gr.NewButton("fix", func () {
fix() if ! fix() {
log.Log(CHANGE, "boo. IPv6 isn't working yet")
return
}
log.Log(CHANGE, "IPv6 WORKED")
// update everything here visually for the user
hostname := me.statusOS.GetHostname()
me.hostname.Set(hostname)
me.hostnameStatus.Set("WORKING")
me.DnsStatus.Set("WORKING")
me.fixButton.Disable()
}) })
grid.Margin() grid.Margin()

View File

@ -59,6 +59,7 @@ type Host struct {
statusIPv6 *gadgets.OneLiner statusIPv6 *gadgets.OneLiner
digStatusButton *gui.Node digStatusButton *gui.Node
witcom *gadgets.BasicWindow witcom *gadgets.BasicWindow
fixButton *gui.Node
} }
type IPtype struct { type IPtype struct {