summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-09 07:07:41 -0500
committerJeff Carr <[email protected]>2025-03-09 07:07:41 -0500
commit66000419bf15cb255e436db44a2a74bf104484e3 (patch)
tree819327cff4db2f2e0e78e6f0caa575ea8e54968d /structs.go
parenteaedaded622316d3b59c2f3765cd2362e96ce54c (diff)
preliminary gui
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/structs.go b/structs.go
index eab8923..1cf6370 100644
--- a/structs.go
+++ b/structs.go
@@ -4,13 +4,20 @@
package main
import (
+ sync "sync"
"time"
+
+ "go.wit.com/gui"
+ "go.wit.com/lib/gadgets"
)
var me *gusconf
// this app's variables
type gusconf struct {
+ myGui *gui.Node // the base of the gui
+ portmaps *Portmaps // the portmap window
+ portwin *stdTableWin // the portwin window
urlbase string // the dns name for the zookeeper
hostname string // my hostname
pollDelay time.Duration // how often to report our status
@@ -18,3 +25,21 @@ type gusconf struct {
failcount int // how many times we've failed to contact the zookeeper
failcountmax int // after this, exit and let systemd restart the daemon
}
+
+type stdTableWin struct {
+ sync.Mutex
+ win *gadgets.GenericWindow // the machines gui window
+ box *gui.Node // the machines gui parent box widget
+ TB *PortmapsTable // the gui table buffer
+ update bool // if the window should be updated
+}
+
+func (w *stdTableWin) Toggle() {
+ if w == nil {
+ return
+ }
+ if w.win == nil {
+ return
+ }
+ w.win.Toggle()
+}