diff --git a/templates/index.html b/templates/index.html index dce679c..e520c88 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8700,6 +8700,8 @@ let tscmWifiDevices = []; let tscmBtDevices = []; let isRecordingBaseline = false; + let tscmSweepStartTime = null; + let tscmSweepEndTime = null; async function refreshTscmDevices() { // Fetch available interfaces for TSCM scanning @@ -8836,9 +8838,12 @@ const data = await response.json(); if (data.status === 'success') { isTscmRunning = true; + tscmSweepStartTime = new Date(); + tscmSweepEndTime = null; document.getElementById('startTscmBtn').style.display = 'none'; document.getElementById('stopTscmBtn').style.display = 'block'; document.getElementById('tscmProgress').style.display = 'flex'; + document.getElementById('tscmReportBtn').style.display = 'none'; // Show warnings if any devices unavailable if (data.warnings && data.warnings.length > 0) { @@ -8903,6 +8908,7 @@ } isTscmRunning = false; + tscmSweepEndTime = new Date(); if (tscmEventSource) { tscmEventSource.close(); tscmEventSource = null; @@ -8911,6 +8917,520 @@ document.getElementById('startTscmBtn').style.display = 'block'; document.getElementById('stopTscmBtn').style.display = 'none'; document.getElementById('tscmProgress').style.display = 'none'; + + // Show report button if we have any data + const hasData = tscmWifiDevices.length > 0 || tscmBtDevices.length > 0 || tscmRfSignals.length > 0; + document.getElementById('tscmReportBtn').style.display = hasData ? 'block' : 'none'; + } + + function generateTscmReport() { + // Calculate sweep duration + const startTime = tscmSweepStartTime || new Date(); + const endTime = tscmSweepEndTime || new Date(); + const durationMs = endTime - startTime; + const durationMin = Math.floor(durationMs / 60000); + const durationSec = Math.floor((durationMs % 60000) / 1000); + + // Categorize devices by classification + const allDevices = [ + ...tscmWifiDevices.map(d => ({...d, protocol: 'WiFi'})), + ...tscmBtDevices.map(d => ({...d, protocol: 'Bluetooth'})), + ...tscmRfSignals.map(d => ({...d, protocol: 'RF'})) + ]; + + const highInterest = allDevices.filter(d => d.classification === 'high_interest' || d.score >= 6); + const needsReview = allDevices.filter(d => d.classification === 'review' || (d.score >= 3 && d.score < 6)); + const informational = allDevices.filter(d => d.classification === 'informational' || d.score < 3); + + // Determine overall assessment + let assessment = 'LOW CONCERN'; + let assessmentClass = 'informational'; + if (highInterest.length > 0) { + assessment = `ELEVATED CONCERN: ${highInterest.length} high-interest item(s) detected requiring immediate attention`; + assessmentClass = 'high-interest'; + } else if (needsReview.length > 0) { + assessment = `MODERATE CONCERN: ${needsReview.length} item(s) requiring further review`; + assessmentClass = 'needs-review'; + } else { + assessment = 'LOW CONCERN: No significant threats detected. Environment appears normal.'; + } + + // Helper function to render device row + const renderDevice = (device) => { + const scoreClass = device.score >= 6 ? 'high' : (device.score >= 3 ? 'medium' : 'low'); + const indicators = (device.indicators || []).map(i => + `${i.type}: ${i.desc}` + ).join(''); + const reasons = (device.reasons || []).map(r => `
| Type | +Device | +Score | +Class | +Signal | +Indicators / Reasons | +Action | +
|---|
| Type | +Device | +Score | +Class | +Signal | +Indicators / Reasons | +Action | +
|---|
| Type | +Device | +Score | +Class | +Signal | +Indicators / Reasons | +Action | +
|---|
No devices were detected during this sweep.
+This report is generated by automated wireless spectrum analysis software. The findings presented are indicators only and do not constitute confirmation of surveillance activity. Many legitimate devices may trigger alerts due to their wireless characteristics.
+Professional TSCM services involve specialized equipment and expertise beyond wireless spectrum analysis, including: non-linear junction detection, thermal imaging, physical inspection, and RF spectrum analysis with calibrated equipment.
+No content was intercepted or decoded during this analysis. This tool only detects the presence and characteristics of wireless transmissions.
+