blob: e55530037b2e576805d34b234d4eaacbf9495e87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
  | 
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (
	sync "sync"
	"time"
	"go.wit.com/gui"
	"go.wit.com/lib/gadgets"
	"go.wit.com/lib/gui/prep"
)
var me *gusconf
// this app's variables
type gusconf struct {
	auto          *prep.Auto        // more experiments for bash handling
	myGui         *prep.GuiPrep     // the base of the gui
	portmaps      *Portmaps         // the portmap window
	portwin       *stdTableWin      // the portwin window
	events        *Events           // the event log
	eventswin     *stdEventTableWin // the event window
	eventsChanged bool              // are there new events?
	urlbase       string            // the dns name for the zookeeper
	hostname      string            // my hostname
	pollDelay     time.Duration     // how often to report our status
	dog           *time.Ticker      // the watchdog timer
	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()
}
type stdEventTableWin struct {
	sync.Mutex
	win    *gadgets.GenericWindow // the machines gui window
	box    *gui.Node              // the machines gui parent box widget
	TB     *EventsTable           // the gui table buffer
	update bool                   // if the window should be updated
}
func (w *stdEventTableWin) Toggle() {
	if w == nil {
		return
	}
	if w.win == nil {
		return
	}
	w.win.Toggle()
}
  |