Merge branch 'jcarr' of git.wit.org:jcarr/control-panel-dns into jcarr

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-02-18 23:22:45 -06:00
commit be1e66cb0b
2 changed files with 39 additions and 0 deletions

23
gui.go
View File

@ -61,6 +61,7 @@ func addDNSTab(window *gui.Node, title string) {
s := tb.GetText() s := tb.GetText()
log("text =", s) log("text =", s)
} }
<<<<<<< HEAD
g2.NewButton("dump Host.ifmap", func () { g2.NewButton("dump Host.ifmap", func () {
for i, t := range me.ifmap { for i, t := range me.ifmap {
log("int =", i, "name =", t.name, t.iface) log("int =", i, "name =", t.name, t.iface)
@ -71,6 +72,28 @@ func addDNSTab(window *gui.Node, title string) {
}) })
g2.NewButton("getHostname()", func () { g2.NewButton("getHostname()", func () {
getHostname() getHostname()
=======
g2.NewButton("Network Interfaces", func () {
for i, t := range me.ifmap {
log("name =", t.iface.Name)
log("int =", i, "name =", t.name, t.iface)
dd.AddDropdownName(t.iface.Name)
}
})
g2.NewButton("Hostname", func () {
getHostname()
g.NewLabel("FQDN = " + me.fqdn)
})
g2.NewButton("Actual AAAA", func () {
var aaaa []string
aaaa = realAAAA()
for _, s := range aaaa {
g.NewLabel("my actual AAAA = " + s)
}
})
g2.NewButton("checkDNS()", func () {
checkDNS()
>>>>>>> eb554cfeb772d3ec3c9bc9612603a7c2c5681ea9
}) })
g2.NewButton("os.User()", func () { g2.NewButton("os.User()", func () {
user, _ := user.Current() user, _ := user.Current()

16
net.go
View File

@ -91,6 +91,22 @@ func checkInterface(i net.Interface) {
} }
} }
<<<<<<< HEAD
=======
func realAAAA() []string {
var aaaa []string
for s, t := range me.ipmap {
if (t.IsReal()) {
if (t.ipv6) {
aaaa = append(aaaa, s)
}
}
}
return aaaa
}
>>>>>>> eb554cfeb772d3ec3c9bc9612603a7c2c5681ea9
func checkDNS() (map[string]*IPtype, map[string]*IPtype) { func checkDNS() (map[string]*IPtype, map[string]*IPtype) {
var ipv4s map[string]*IPtype var ipv4s map[string]*IPtype
var ipv6s map[string]*IPtype var ipv6s map[string]*IPtype