2024-01-05 18:52:47 -06:00
|
|
|
// This is a simple example
|
|
|
|
package cloudflare
|
|
|
|
|
2024-01-18 01:33:28 -06:00
|
|
|
import (
|
|
|
|
"go.wit.com/log"
|
2024-01-21 02:10:00 -06:00
|
|
|
"go.wit.com/gui"
|
2024-01-05 18:52:47 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func drawZoneBox(box *gui.Node) {
|
|
|
|
g1 := box.NewGroup("zones")
|
|
|
|
|
|
|
|
// make dropdown list of zones
|
2024-01-18 01:23:49 -06:00
|
|
|
CFdialog.zonedrop = g1.NewDropdown().SetProgName("ZONES")
|
2024-01-05 18:52:47 -06:00
|
|
|
CFdialog.zonedrop.AddText("example.org")
|
|
|
|
for d, _ := range Config {
|
|
|
|
CFdialog.zonedrop.AddText(d)
|
|
|
|
}
|
|
|
|
CFdialog.zonedrop.AddText("stablesid.org")
|
|
|
|
|
2024-01-18 01:33:28 -06:00
|
|
|
CFdialog.zonedrop.Custom = func() {
|
2024-01-18 01:23:49 -06:00
|
|
|
domain := CFdialog.zonedrop.String()
|
|
|
|
log.Log(INFO, "custom dropdown() zone (domain name) =", CFdialog.zonedrop.String(), domain)
|
2024-01-18 01:33:28 -06:00
|
|
|
if Config[domain] == nil {
|
2024-01-05 19:33:41 -06:00
|
|
|
log.Log(INFO, "custom dropdown() Config[domain] = nil for domain =", domain)
|
2024-01-05 18:52:47 -06:00
|
|
|
CFdialog.domainWidget.SetText(domain)
|
|
|
|
CFdialog.zoneWidget.SetText("")
|
|
|
|
CFdialog.authWidget.SetText("")
|
|
|
|
CFdialog.emailWidget.SetText("")
|
|
|
|
} else {
|
2024-01-05 19:33:41 -06:00
|
|
|
log.Log(INFO, "custom dropdown() a =", domain, Config[domain].ZoneID, Config[domain].Auth, Config[domain].Email)
|
2024-01-05 18:52:47 -06:00
|
|
|
CFdialog.domainWidget.SetText(Config[domain].Domain)
|
|
|
|
CFdialog.zoneWidget.SetText(Config[domain].ZoneID)
|
|
|
|
CFdialog.authWidget.SetText(Config[domain].Auth)
|
|
|
|
CFdialog.emailWidget.SetText(Config[domain].Email)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
more := g1.NewGroup("data")
|
|
|
|
showCloudflareCredentials(more)
|
|
|
|
}
|