path changes

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-18 01:23:49 -06:00
parent 3667f8a936
commit 586494505b
4 changed files with 30 additions and 30 deletions

24
api.go
View File

@ -23,22 +23,22 @@ func DoChange() *RRT {
dnsRow = new(RRT)
log.Log(INFO, "DoChange() START")
if (CFdialog.proxyNode.GetText() == "On") {
if (CFdialog.proxyNode.String() == "On") {
dnsRow.Proxied = true
} else {
dnsRow.Proxied = false
}
dnsRow.Auth = CFdialog.apiNode.GetText()
dnsRow.Email = CFdialog.emailNode.GetText()
dnsRow.Auth = CFdialog.apiNode.String()
dnsRow.Email = CFdialog.emailNode.String()
dnsRow.Domain = CFdialog.zoneNode.GetText()
dnsRow.ZoneID = CFdialog.zoneIdNode.GetText()
dnsRow.ID = CFdialog.rrNode.GetText()
dnsRow.Domain = CFdialog.zoneNode.String()
dnsRow.ZoneID = CFdialog.zoneIdNode.String()
dnsRow.ID = CFdialog.rrNode.String()
dnsRow.Content = CFdialog.ValueNode.GetText()
dnsRow.Name = CFdialog.NameNode.GetText()
dnsRow.Type = CFdialog.TypeNode.GetText()
dnsRow.url = CFdialog.urlNode.GetText()
dnsRow.Content = CFdialog.ValueNode.String()
dnsRow.Name = CFdialog.NameNode.String()
dnsRow.Type = CFdialog.TypeNode.String()
dnsRow.url = CFdialog.urlNode.String()
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.GetText())
log.Log(INFO, "Proxy", dnsRow.Proxied, "vs", CFdialog.proxyNode.String())
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.GetText())
log.Log(INFO, "Content", dnsRow.Content, "vs", CFdialog.ValueNode.String())
CFdialog.ValueNode.SetText(dnsRow.Content)
}
if (CFdialog.NameNode != nil) {

View File

@ -25,7 +25,7 @@ func MakeCloudflareWindow(n *gui.Node) *gadgets.BasicWindow {
g1 := win.Box().NewGroup("zones")
// make dropdown list of zones
CFdialog.zonedrop = g1.NewDropdown("zone")
CFdialog.zonedrop = g1.NewDropdown()
CFdialog.zonedrop.AddText("example.org")
for d, _ := range Config {
CFdialog.zonedrop.AddText(d)
@ -33,8 +33,8 @@ func MakeCloudflareWindow(n *gui.Node) *gadgets.BasicWindow {
CFdialog.zonedrop.AddText("stablesid.org")
CFdialog.zonedrop.Custom = func () {
domain := CFdialog.zonedrop.GetText()
log.Log(ZONE, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.GetText(), domain)
domain := CFdialog.zonedrop.String()
log.Log(ZONE, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.String(), domain)
if (Config[domain] == nil) {
log.Log(ZONE, "custom dropdown() Config[domain] = nil for domain =", domain)
CFdialog.domainWidget.SetText(domain)
@ -82,9 +82,9 @@ func makeConfigWindow(vb *gui.Node) {
grid.Pad()
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.GetText(), ew.GetText())
log.Log(INFO, "Find all the Resource Records for hostname:", hostname.String())
log.Log(INFO, "Find all the Resource Records for zone:", zone.String())
GetZones(aw.String(), ew.String())
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.GetText(), ew.GetText())
GetZones(aw.String(), ew.String())
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.GetText()
domain.ZoneID = CFdialog.zoneWidget.GetText()
domain.Auth = CFdialog.authWidget.GetText()
domain.Email = CFdialog.emailWidget.GetText()
domain.Domain = CFdialog.domainWidget.String()
domain.ZoneID = CFdialog.zoneWidget.String()
domain.Auth = CFdialog.authWidget.String()
domain.Email = CFdialog.emailWidget.String()
LoadZoneWindow(CFdialog.mainWindow.Box(), &domain)
})
}

8
rr.go
View File

@ -53,7 +53,7 @@ func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow
CFdialog.rrNode.SetText(os.Getenv("cloudflare RR id"))
grid.NewLabel("Record Type")
CFdialog.TypeNode = grid.NewCombobox("type")
CFdialog.TypeNode = grid.NewCombobox()
CFdialog.TypeNode.AddText("A")
CFdialog.TypeNode.AddText("AAAA")
CFdialog.TypeNode.AddText("CNAME")
@ -66,7 +66,7 @@ func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow
CFdialog.TypeNode.SetText("AAAA")
grid.NewLabel("Name (usually the hostname)")
CFdialog.NameNode = grid.NewCombobox("name")
CFdialog.NameNode = grid.NewCombobox()
CFdialog.NameNode.AddText("www")
CFdialog.NameNode.AddText("mail")
CFdialog.NameNode.AddText("git")
@ -79,7 +79,7 @@ func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow
CFdialog.NameNode.SetText("www")
grid.NewLabel("Cloudflare Proxy")
CFdialog.proxyNode = grid.NewDropdown("proxy")
CFdialog.proxyNode = grid.NewDropdown()
CFdialog.proxyNode.AddText("On")
CFdialog.proxyNode.AddText("Off")
CFdialog.proxyNode.Custom = func () {
@ -88,7 +88,7 @@ func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow
CFdialog.proxyNode.SetText("Off")
grid.NewLabel("Value")
CFdialog.ValueNode = grid.NewCombobox("value")
CFdialog.ValueNode = grid.NewCombobox()
CFdialog.ValueNode.AddText("127.0.0.1")
CFdialog.ValueNode.AddText("2001:4860:4860::8888")
CFdialog.ValueNode.AddText("ipv6.wit.com")

View File

@ -10,7 +10,7 @@ func drawZoneBox(box *gui.Node) {
g1 := box.NewGroup("zones")
// make dropdown list of zones
CFdialog.zonedrop = g1.NewDropdown("zone")
CFdialog.zonedrop = g1.NewDropdown().SetProgName("ZONES")
CFdialog.zonedrop.AddText("example.org")
for d, _ := range Config {
CFdialog.zonedrop.AddText(d)
@ -18,8 +18,8 @@ func drawZoneBox(box *gui.Node) {
CFdialog.zonedrop.AddText("stablesid.org")
CFdialog.zonedrop.Custom = func () {
domain := CFdialog.zonedrop.GetText()
log.Log(INFO, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.GetText(), domain)
domain := CFdialog.zonedrop.String()
log.Log(INFO, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.String(), domain)
if (Config[domain] == nil) {
log.Log(INFO, "custom dropdown() Config[domain] = nil for domain =", domain)
CFdialog.domainWidget.SetText(domain)