api update

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-11 22:30:47 -06:00
parent d4f7337202
commit 7c02449c71
3 changed files with 20 additions and 20 deletions

24
api.go
View File

@ -23,22 +23,22 @@ func DoChange() *RRT {
dnsRow = new(RRT) dnsRow = new(RRT)
log.Log(INFO, "DoChange() START") log.Log(INFO, "DoChange() START")
if (CFdialog.proxyNode.S == "On") { if (CFdialog.proxyNode.GetText() == "On") {
dnsRow.Proxied = true dnsRow.Proxied = true
} else { } else {
dnsRow.Proxied = false dnsRow.Proxied = false
} }
dnsRow.Auth = CFdialog.apiNode.S dnsRow.Auth = CFdialog.apiNode.GetText()
dnsRow.Email = CFdialog.emailNode.S dnsRow.Email = CFdialog.emailNode.GetText()
dnsRow.Domain = CFdialog.zoneNode.S dnsRow.Domain = CFdialog.zoneNode.GetText()
dnsRow.ZoneID = CFdialog.zoneIdNode.S dnsRow.ZoneID = CFdialog.zoneIdNode.GetText()
dnsRow.ID = CFdialog.rrNode.S dnsRow.ID = CFdialog.rrNode.GetText()
dnsRow.Content = CFdialog.ValueNode.S dnsRow.Content = CFdialog.ValueNode.GetText()
dnsRow.Name = CFdialog.NameNode.S dnsRow.Name = CFdialog.NameNode.GetText()
dnsRow.Type = CFdialog.TypeNode.S dnsRow.Type = CFdialog.TypeNode.GetText()
dnsRow.url = CFdialog.urlNode.S dnsRow.url = CFdialog.urlNode.GetText()
dnsRow.data = makeJSON(dnsRow) dnsRow.data = makeJSON(dnsRow)
// show the JSON // show the JSON
@ -55,7 +55,7 @@ func DoChange() *RRT {
func SetRow(dnsRow *RRT) { func SetRow(dnsRow *RRT) {
log.Log(INFO, "Look for changes in row", dnsRow.ID) log.Log(INFO, "Look for changes in row", dnsRow.ID)
if (CFdialog.proxyNode != nil) { if (CFdialog.proxyNode != nil) {
log.Log(INFO, "Proxy", dnsRow.Proxied, "vs", CFdialog.proxyNode.S) log.Log(INFO, "Proxy", dnsRow.Proxied, "vs", CFdialog.proxyNode.GetText())
if (dnsRow.Proxied == true) { if (dnsRow.Proxied == true) {
CFdialog.proxyNode.SetText("On") CFdialog.proxyNode.SetText("On")
} else { } else {
@ -73,7 +73,7 @@ func SetRow(dnsRow *RRT) {
CFdialog.rrNode.SetText(dnsRow.ID) CFdialog.rrNode.SetText(dnsRow.ID)
} }
if (CFdialog.ValueNode != nil) { if (CFdialog.ValueNode != nil) {
log.Log(INFO, "Content", dnsRow.Content, "vs", CFdialog.ValueNode.S) log.Log(INFO, "Content", dnsRow.Content, "vs", CFdialog.ValueNode.GetText())
CFdialog.ValueNode.SetText(dnsRow.Content) CFdialog.ValueNode.SetText(dnsRow.Content)
} }
if (CFdialog.NameNode != nil) { if (CFdialog.NameNode != nil) {

View File

@ -33,7 +33,7 @@ func MakeCloudflareWindow(n *gui.Node) *gadgets.BasicWindow {
CFdialog.zonedrop.AddText("stablesid.org") CFdialog.zonedrop.AddText("stablesid.org")
CFdialog.zonedrop.Custom = func () { CFdialog.zonedrop.Custom = func () {
domain := CFdialog.zonedrop.S domain := CFdialog.zonedrop.GetText()
log.Log(ZONE, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.GetText(), domain) log.Log(ZONE, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.GetText(), domain)
if (Config[domain] == nil) { if (Config[domain] == nil) {
log.Log(ZONE, "custom dropdown() Config[domain] = nil for domain =", domain) log.Log(ZONE, "custom dropdown() Config[domain] = nil for domain =", domain)
@ -84,7 +84,7 @@ func makeConfigWindow(vb *gui.Node) {
vb.NewButton("Lookup Hostname", func () { vb.NewButton("Lookup Hostname", func () {
log.Log(INFO, "Find all the Resource Records for hostname:", hostname.Get()) log.Log(INFO, "Find all the Resource Records for hostname:", hostname.Get())
log.Log(INFO, "Find all the Resource Records for zone:", zone.Get()) log.Log(INFO, "Find all the Resource Records for zone:", zone.Get())
GetZones(aw.S, ew.S) GetZones(aw.GetText(), ew.GetText())
for d, v := range Config { for d, v := range Config {
log.Log(ZONE, "Zone =", d, "v =", v) log.Log(ZONE, "Zone =", d, "v =", v)
} }
@ -92,7 +92,7 @@ func makeConfigWindow(vb *gui.Node) {
vb.NewButton("getZones()", func () { vb.NewButton("getZones()", func () {
log.Log(ZONE, "getZones()") log.Log(ZONE, "getZones()")
GetZones(aw.S, ew.S) GetZones(aw.GetText(), ew.GetText())
for d, _ := range Config { for d, _ := range Config {
CFdialog.zonedrop.AddText(d) CFdialog.zonedrop.AddText(d)
} }
@ -132,10 +132,10 @@ func showCloudflareCredentials(box *gui.Node) {
CFdialog.loadButton = box.NewButton("Load Cloudflare DNS zonefile", func () { CFdialog.loadButton = box.NewButton("Load Cloudflare DNS zonefile", func () {
var domain ConfigT var domain ConfigT
domain.Domain = CFdialog.domainWidget.S domain.Domain = CFdialog.domainWidget.GetText()
domain.ZoneID = CFdialog.zoneWidget.S domain.ZoneID = CFdialog.zoneWidget.GetText()
domain.Auth = CFdialog.authWidget.S domain.Auth = CFdialog.authWidget.GetText()
domain.Email = CFdialog.emailWidget.S domain.Email = CFdialog.emailWidget.GetText()
LoadZoneWindow(CFdialog.mainWindow.Box(), &domain) LoadZoneWindow(CFdialog.mainWindow.Box(), &domain)
}) })
} }

View File

@ -18,7 +18,7 @@ func drawZoneBox(box *gui.Node) {
CFdialog.zonedrop.AddText("stablesid.org") CFdialog.zonedrop.AddText("stablesid.org")
CFdialog.zonedrop.Custom = func () { CFdialog.zonedrop.Custom = func () {
domain := CFdialog.zonedrop.S domain := CFdialog.zonedrop.GetText()
log.Log(INFO, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.GetText(), domain) log.Log(INFO, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.GetText(), domain)
if (Config[domain] == nil) { if (Config[domain] == nil) {
log.Log(INFO, "custom dropdown() Config[domain] = nil for domain =", domain) log.Log(INFO, "custom dropdown() Config[domain] = nil for domain =", domain)