Multi-instance terminal UI dashboard for monitoring all ServeGo
short-URL/redirect processes simultaneously. Uses MQTT heartbeats for live
instance tracking and a slow DB poll for static configuration data.
GoTUI subscribes to MQTT topic axion/+/heartbeat/go/+ to receive retained
heartbeats from every running ServeGo instance. An instance is shown as stale
after TuiConstants.HEARTBEAT_STALE_SECS (45 s).
The def_go table is polled separately every TuiConstants.CONFIG_POLL_SECS
(60 s).
__init__(self)Initialises theme, console, layout, and internal state. No port parameter —
all instance data arrives via MQTT.
start(self) / stop(self)start() calls _start_mqtt(), renders the initial layout, and launches the
background update thread. stop() disconnects the MQTT client and tears down
the Live context.
_start_mqtt(self) (internal)Connects a paho MQTT client, subscribes to the heartbeat wildcard, and updates
self.instances[instance_id] on each message.
_poll_config(self) (internal)Runs every CONFIG_POLL_SECS. Queries def_go WHERE Package = ? for count
and a (SourceCode, Description) listing.
| Panel | Content |
|---|---|
| Header | Heartbeat, package, Instances: N/M, clock, uptime |
| Sidebar | Package, active/total counts, DB status, go-page count, TUI uptime |
| Instances | Table of all known instances — instance ID, package, uptime, PID, status |
| Go Pages | Table of go page definitions — source code, description |
| Log | Scrolling log |
| Footer | Last config poll timestamp |
python ServeGo.py tui
Press Ctrl+C to exit.