fix(drone): show sidebar panel and expose SDR config options

Remove inline style="display: none;" that was preventing the droneMode
panel from becoming visible when the active class was toggled — inline
styles override CSS class rules without !important. Add RTL-SDR device
index and HackRF toggle inputs that the backend already accepted but
were never surfaced in the UI; wire them through to the /drone/start
POST body.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-05-13 09:07:42 +01:00
parent 8f6bfb4df1
commit 2475e5dd5a
2 changed files with 16 additions and 2 deletions
+3 -1
View File
@@ -159,10 +159,12 @@
function _start() {
const iface = document.getElementById('droneWifiIface')?.value.trim() || null;
const rtlIndex = parseInt(document.getElementById('droneRtlIndex')?.value, 10) || 0;
const useHackrf = document.getElementById('droneUseHackrf')?.checked ?? true;
fetch('/drone/start', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ wifi_iface: iface }),
body: JSON.stringify({ wifi_iface: iface, rtl_sdr_index: rtlIndex, use_hackrf: useHackrf }),
})
.then(function (r) { return r.json(); })
.then(function () { _setRunningUI(true); _refreshStatus(); })
+13 -1
View File
@@ -1,5 +1,5 @@
<!-- DRONE INTELLIGENCE MODE -->
<div id="droneMode" class="mode-content" style="display: none;">
<div id="droneMode" class="mode-content">
<div class="section">
<h3>Drone Intelligence</h3>
<p class="info-text" style="margin-bottom: 12px;">
@@ -21,6 +21,18 @@
<input type="text" id="droneWifiIface" placeholder="e.g. wlan0mon" style="width:100%;">
</div>
<div class="section">
<h3>RTL-SDR Device <span style="font-weight:400; font-size:11px; color:var(--text-dim)">(433 MHz)</span></h3>
<input type="number" id="droneRtlIndex" value="0" min="0" max="7" style="width:100%;" placeholder="Device index">
</div>
<div class="section">
<label class="inline-checkbox">
<input type="checkbox" id="droneUseHackrf" checked>
Use HackRF <span style="font-size:10px; color:var(--text-dim);">(2.4 / 5.8 GHz)</span>
</label>
</div>
<div class="section">
<div style="display:flex; gap:8px;">
<button id="droneStartBtn" class="run-btn" style="flex:1;">Start</button>