From 09ed8c6188afd658917ddfe279d5c8033d942d11 Mon Sep 17 00:00:00 2001 From: Smittix Date: Mon, 2 Feb 2026 21:36:27 +0000 Subject: [PATCH] Add SDR device status panel and ADS-B Bias-T toggle - Add /devices/status endpoint showing which SDR is in use and by what mode - Add real-time status panel on main dashboard with 5s auto-refresh - Add Bias-T toggle to ADS-B dashboard with localStorage persistence - Auto-detect correct dump1090 bias-t flag (--enable-biast vs unsupported) - Standardize SDR device labels across all pages Closes #102 Co-Authored-By: Claude Opus 4.5 --- app.py | 16 +++ static/css/adsb_dashboard.css | 18 +++ templates/adsb_dashboard.html | 214 ++++++++++++++++++---------------- templates/adsb_history.html | 4 +- templates/index.html | 79 +++++++++++++ utils/sdr/rtlsdr.py | 42 ++++++- 6 files changed, 266 insertions(+), 107 deletions(-) diff --git a/app.py b/app.py index 84cb522..3b6e1ee 100644 --- a/app.py +++ b/app.py @@ -347,6 +347,22 @@ def get_devices() -> Response: return jsonify([d.to_dict() for d in devices]) +@app.route('/devices/status') +def get_devices_status() -> Response: + """Get all SDR devices with usage status.""" + devices = SDRFactory.detect_devices() + registry = get_sdr_device_status() + + result = [] + for device in devices: + d = device.to_dict() + d['in_use'] = device.index in registry + d['used_by'] = registry.get(device.index) + result.append(d) + + return jsonify(result) + + @app.route('/devices/debug') def get_devices_debug() -> Response: """Get detailed SDR device detection diagnostics.""" diff --git a/static/css/adsb_dashboard.css b/static/css/adsb_dashboard.css index 22ccd18..9afac6f 100644 --- a/static/css/adsb_dashboard.css +++ b/static/css/adsb_dashboard.css @@ -814,6 +814,24 @@ body { color: var(--accent-green); } +/* Bias-T toggle styling */ +.bias-t-label { + display: flex; + align-items: center; + gap: 4px; + padding: 3px 8px; + background: linear-gradient(90deg, rgba(255, 100, 0, 0.15), rgba(255, 100, 0, 0.05)); + border: 1px solid var(--accent-orange, #ff6400); + border-radius: 4px; + color: var(--accent-orange, #ff6400); + font-weight: 500; + font-size: 10px; +} + +.bias-t-label input[type="checkbox"] { + accent-color: var(--accent-orange, #ff6400); +} + .control-group.airband-group { background: rgba(245, 158, 11, 0.05); border-color: rgba(245, 158, 11, 0.2); diff --git a/templates/adsb_dashboard.html b/templates/adsb_dashboard.html index 725e3ca..639e140 100644 --- a/templates/adsb_dashboard.html +++ b/templates/adsb_dashboard.html @@ -17,15 +17,15 @@ {% else %} - {% endif %} - - - - - + {% endif %} + + + + +
@@ -269,6 +269,7 @@ + @@ -322,10 +323,23 @@