diff options
| author | Jeff Carr <[email protected]> | 2023-12-21 17:56:56 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-21 17:56:56 -0600 |
| commit | 73b0cee93320bb5b572881cd1a5ba9d878a4ba3a (patch) | |
| tree | 615e3c84e31ce55ac83399409eb068c979dff2e5 /gui.go | |
| parent | 7409b58ea37becdd7fba7d3da8e1994aa55f7922 (diff) | |
add a DurationSlider()v0.2.2
widgets to adjust timeouts
redo bash curl.sh example
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
| -rw-r--r-- | gui.go | 23 |
1 files changed, 8 insertions, 15 deletions
@@ -4,6 +4,7 @@ package main import ( "log" "fmt" + "time" "os" "os/user" "strconv" @@ -12,6 +13,7 @@ import ( "go.wit.com/gui" "go.wit.com/shell" + "go.wit.com/control-panel-dns/cloudflare" "github.com/davecgh/go-spew/spew" ) @@ -172,22 +174,13 @@ func debugTab(title string) { LogProc = me.dbProc.B } - // various timeout settings - g2.NewLabel("control panel TTL (in tenths of seconds)") - ttl := g2.NewSlider("dnsTTL", 1, 100) - ttl.Set(int(me.dnsTTL * 10)) - ttl.Custom = func () { - me.dnsTTL = ttl.I / 10 - log.Println("dnsTTL =", me.dnsTTL) - } + // makes a slider widget + me.ttl = cloudflare.NewDurationSlider(g2, "Loop Timeout", 10 * time.Millisecond, 5 * time.Second) + me.ttl.Set(300 * time.Millisecond) - g2.NewLabel("control panel loop delay (in tenths of seconds)") - ttl2 := g2.NewSlider("dnsTTL", 1, 100) - ttl2.Set(int(me.dnsTTLsleep * 10)) - ttl2.Custom = func () { - me.dnsTTLsleep = float64(ttl2.I) / 10 - log.Println("dnsTTLsleep =", me.dnsTTLsleep) - } + // makes a slider widget + me.dnsTtl = cloudflare.NewDurationSlider(g2, "DNS Timeout", 800 * time.Millisecond, 300 * time.Second) + me.dnsTtl.Set(60 * time.Second) g2.Margin() g2.Pad() |
