diff --git a/drb-edge-node/app/internal/metadata_watcher.py b/drb-edge-node/app/internal/metadata_watcher.py index a44f75c..f932c9e 100644 --- a/drb-edge-node/app/internal/metadata_watcher.py +++ b/drb-edge-node/app/internal/metadata_watcher.py @@ -123,6 +123,10 @@ class MetadataWatcher: def current_tgid(self) -> Optional[int]: return self._current_tgid + @property + def current_tgid_name(self) -> Optional[str]: + return self._current_tgid_name + @property def is_active(self) -> bool: return self._active_call_id is not None diff --git a/drb-edge-node/app/routers/api.py b/drb-edge-node/app/routers/api.py index 7f21fa8..f46075c 100644 --- a/drb-edge-node/app/routers/api.py +++ b/drb-edge-node/app/routers/api.py @@ -14,6 +14,21 @@ router = APIRouter(prefix="/api", tags=["api"]) async def get_status(): node_cfg = load_node_config() op25_status = await op25_client.status() + + active_tgid = metadata_watcher.current_tgid + active_tgid_name = metadata_watcher.current_tgid_name + system_name = None + + if node_cfg.system_config: + system_name = node_cfg.system_config.name + if active_tgid: + # Reverse engineer the TGID to talkgroup name based on system object + tgs = node_cfg.system_config.config.get("talkgroups", []) + for tg in tgs: + if str(tg.get("id")) == str(active_tgid): + active_tgid_name = tg.get("name") + break + return { "node_id": settings.node_id, "node_name": settings.node_name, @@ -21,8 +36,10 @@ async def get_status(): "lon": settings.node_lon, "configured": node_cfg.configured, "assigned_system_id": node_cfg.assigned_system_id, + "system_name": system_name, "is_recording": call_recorder.is_recording, - "active_tgid": metadata_watcher.current_tgid, + "active_tgid": active_tgid, + "active_tgid_name": active_tgid_name, "active_call_id": metadata_watcher.active_call_id, "discord_connected": radio_bot.is_connected, "icecast_url": ( diff --git a/drb-edge-node/app/routers/ui.py b/drb-edge-node/app/routers/ui.py index d64448b..0763aa0 100644 --- a/drb-edge-node/app/routers/ui.py +++ b/drb-edge-node/app/routers/ui.py @@ -5,8 +5,14 @@ from fastapi.responses import HTMLResponse router = APIRouter(tags=["ui"]) _TEMPLATE = Path(__file__).parent.parent / "templates" / "index.html" +_SCANNER_TEMPLATE = Path(__file__).parent.parent / "templates" / "scanner.html" @router.get("/", response_class=HTMLResponse) async def index(): return _TEMPLATE.read_text() + + +@router.get("/scanner", response_class=HTMLResponse) +async def scanner(): + return _SCANNER_TEMPLATE.read_text() diff --git a/drb-edge-node/app/templates/index.html b/drb-edge-node/app/templates/index.html index 92a8991..9d10407 100644 --- a/drb-edge-node/app/templates/index.html +++ b/drb-edge-node/app/templates/index.html @@ -3,186 +3,419 @@ - DRB Edge Node + DRB Edge Node Dashboard + -

DRB Edge Node

-

Loading…

+
+
+
+

DRB Edge Node

+

ID: Loading…

+
+ +
-
-
-
Status
-
- State - -
-
- MQTT - -
-
- Discord - -
-
- Recording - + -
-
Current Call
-
- Talkgroup - +
+ +
+
+
System Status
+
+
+ State + +
+
+ Discord + +
+
+ Recording + +
+
+ OP25 Core + +
-
- Call ID - + + +
+
+
Live Activity
+
+
+ System + +
+
+ Talkgroup + +
+
+ TGID + +
+
+ Call ID + +
-
- System - + + +
+
+
Hardware & Config
+
+
+ Location + +
+
+ Configured + +
+
+ System ID + +
-
- OP25 - + + +
+
+
Local Audio Stream
+
+
+ + Direct Link +
-
-
Node Info
-
- Lat / Lon - -
-
- Configured - -
- Listen via Icecast +
- - -

Last updated:

- diff --git a/drb-edge-node/app/templates/scanner.html b/drb-edge-node/app/templates/scanner.html new file mode 100644 index 0000000..8b9e21c --- /dev/null +++ b/drb-edge-node/app/templates/scanner.html @@ -0,0 +1,268 @@ + + + + + + Scanner Display + + + +
+
▶ RUNNING
+
12:00:00
+
VOL: 100%
+
+ +
+
NO SYSTEM
+
Scanning...
+
IDLE
+
+ +
+
+ TGID + --- +
+
+ Node ID + --- +
+
+ +
+
System
+
Dept
+
Chan
+
+ +
HOLD
+ + + + + + +