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

View File

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

View File

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