mirror of
https://github.com/smittix/intercept.git
synced 2026-05-29 20:59:27 -07:00
Fix RF scanning and add status feedback
- Remove requirement for sdr_device to be set before RF scanning - Add RTL-SDR device detection check with rtl_test before scanning - Lower signal detection threshold from -50dBm to -70dBm - Lower noise floor threshold from 15dB to 10dB above noise - Add rf_status event for frontend feedback when RF unavailable - Show status message in RF panel explaining why scanning isn't working - Add CSS styling for status messages - Reset RF status message when sweep starts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2061,6 +2061,20 @@
|
||||
.classification-indicator {
|
||||
margin-right: 6px;
|
||||
}
|
||||
.tscm-status-message {
|
||||
padding: 12px;
|
||||
background: rgba(255, 153, 51, 0.15);
|
||||
border: 1px solid rgba(255, 153, 51, 0.3);
|
||||
border-radius: 6px;
|
||||
color: var(--text-primary);
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.tscm-status-message .status-icon {
|
||||
font-size: 16px;
|
||||
}
|
||||
.tscm-device-reasons {
|
||||
font-size: 10px;
|
||||
color: var(--text-secondary);
|
||||
@@ -10189,6 +10203,7 @@
|
||||
tscmWifiDevices = [];
|
||||
tscmBtDevices = [];
|
||||
tscmRfSignals = [];
|
||||
tscmRfStatusMessage = null;
|
||||
updateTscmDisplays();
|
||||
|
||||
// Start SSE stream
|
||||
@@ -10281,6 +10296,9 @@
|
||||
case 'rf_signal':
|
||||
addTscmRfSignal(data);
|
||||
break;
|
||||
case 'rf_status':
|
||||
handleRfStatus(data);
|
||||
break;
|
||||
case 'threat_detected':
|
||||
addTscmThreat(data);
|
||||
break;
|
||||
@@ -10331,7 +10349,11 @@
|
||||
}
|
||||
|
||||
let tscmRfSignals = [];
|
||||
let tscmRfStatusMessage = null;
|
||||
|
||||
function addTscmRfSignal(signal) {
|
||||
// Clear any error message since we're receiving signals
|
||||
tscmRfStatusMessage = null;
|
||||
// Check if already exists (within 0.1 MHz)
|
||||
const exists = tscmRfSignals.some(s => Math.abs(s.frequency - signal.frequency) < 0.1);
|
||||
if (!exists) {
|
||||
@@ -10345,6 +10367,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
function handleRfStatus(data) {
|
||||
// Store status message to display in RF panel
|
||||
tscmRfStatusMessage = data.message;
|
||||
updateRfDisplay();
|
||||
}
|
||||
|
||||
function updateRfDisplay() {
|
||||
const rfList = document.getElementById('tscmRfList');
|
||||
if (!rfList) return;
|
||||
|
||||
if (tscmRfSignals.length === 0) {
|
||||
if (tscmRfStatusMessage) {
|
||||
rfList.innerHTML = `<div class="tscm-status-message"><span class="status-icon">⚠️</span> ${escapeHtml(tscmRfStatusMessage)}</div>`;
|
||||
} else {
|
||||
rfList.innerHTML = '<div class="tscm-empty">No RF signals detected</div>';
|
||||
}
|
||||
}
|
||||
// If there are signals, updateTscmDisplays() will handle the display
|
||||
}
|
||||
|
||||
// Track high-interest devices for the threats panel
|
||||
let tscmHighInterestDevices = [];
|
||||
function addHighInterestDevice(device, protocol) {
|
||||
@@ -10780,7 +10822,11 @@
|
||||
// Update RF list
|
||||
const rfList = document.getElementById('tscmRfList');
|
||||
if (tscmRfSignals.length === 0) {
|
||||
rfList.innerHTML = '<div class="tscm-empty">No RF signals detected</div>';
|
||||
if (tscmRfStatusMessage) {
|
||||
rfList.innerHTML = `<div class="tscm-status-message"><span class="status-icon">⚠️</span> ${escapeHtml(tscmRfStatusMessage)}</div>`;
|
||||
} else {
|
||||
rfList.innerHTML = '<div class="tscm-empty">No RF signals detected</div>';
|
||||
}
|
||||
} else {
|
||||
// Sort by score (highest first)
|
||||
const sorted = [...tscmRfSignals].sort((a, b) => (b.score || 0) - (a.score || 0));
|
||||
|
||||
Reference in New Issue
Block a user