Files
hblink3/hblink3-dash.service
Cort BuffingtonandClaude Opus 4.8 2836f71ec7 Add HBlink3 dashboard (FastAPI + Uvicorn, modern UI)
A real-time web dashboard for HBlink3 -- a separate program that replaces the old
HBmonitor. It keeps HBmonitor's information and table layout (master systems with
their repeaters, peer systems, OpenBridge systems, conference-bridge state, and a
call log) but borrows HBlink4's modern dark aesthetic and an efficient,
event-driven data path.

How it works:
- dashboard/server.py connects to HBlink3's NDJSON reporting feed, maintains the
  authoritative display state, resolves DMR IDs to callsigns/talkgroup names via
  the shared alias files, and serves a single-page UI plus a WebSocket that pushes
  JSON deltas (and a small REST API at /api/state).
- dashboard/static/dashboard.html renders the tables client-side and ticks the
  uptime / call-duration / bridge-timeout counters in the browser, so there are no
  full-table re-renders and the duration figures update live. Live calls are
  pushed instantly; systems/peer state refreshes on the periodic config snapshot
  (REPORT_INTERVAL).

Efficiency vs HBmonitor: JSON deltas instead of whole-table HTML pushed every
tick; client-side rendering and live counters; no pickle on the wire; server-
computed time deltas so the browser needs no clock sync.

Includes config_sample.py, requirements.txt (FastAPI/Uvicorn/dmr_utils3 -- the
core stays stdlib-only), README, run_dashboard.py launcher, and an
hblink3-dash.service systemd unit. dashboard/config.py is git-ignored.

Verified end-to-end against a live bridge.py: the dashboard ingests the config
and bridge snapshots, resolves a talkgroup alias, and serves the branded SPA;
frontend JS parses clean; the HBlink3 core test suite is unaffected (39 tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 13:54:28 -05:00

36 lines
894 B
Desktop File

# systemd unit for the HBlink3 dashboard (dashboard/server.py).
#
# Install:
# sudo cp hblink3-dash.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable --now hblink3-dash
#
# Adjust User/Group and the paths below to your install. The dashboard reads
# dashboard/config.py for its settings (copy it from dashboard/config_sample.py).
[Unit]
Description=HBlink3 Dashboard
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=cort
Group=cort
WorkingDirectory=/home/cort/hblink3/dashboard
ExecStart=/home/cort/hblink3/venv/bin/python /home/cort/hblink3/dashboard/server.py
Restart=always
RestartSec=10
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
# Logging to the journal (journalctl -u hblink3-dash)
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hblink3-dash
[Install]
WantedBy=multi-user.target