diff --git a/templates/index.html b/templates/index.html
index 1dc4a20..f226205 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1352,7 +1352,8 @@
-
+
+
+
+
+
+
+
SELECTED TARGET
+
+
+ Click an aircraft to view details
+
+
+
+
+
+
TRACKED AIRCRAFT
+
+
+ No aircraft detected
+
+
+
+
+
+ Open Full Dashboard
+
+
@@ -1760,6 +1786,7 @@
let activeSquawkAlerts = {}; // Active emergency squawk alerts
let alertedAircraft = {}; // Track aircraft that have already triggered alerts
let adsbAlertsEnabled = true; // Toggle for audio alerts
+ let selectedMainAircraft = null; // Selected aircraft in main tab
// UTC Clock Update
function updateHeaderClock() {
@@ -2340,9 +2367,9 @@
document.getElementById('toolStatusSensor').style.display = (mode === 'sensor') ? 'grid' : 'none';
document.getElementById('toolStatusAircraft').style.display = (mode === 'aircraft') ? 'grid' : 'none';
- // Hide waterfall and output console for satellite/listening modes (use their own visualizations)
- document.querySelector('.waterfall-container').style.display = (mode === 'satellite' || mode === 'listening') ? 'none' : 'block';
- document.getElementById('output').style.display = (mode === 'satellite') ? 'none' : 'block';
+ // Hide waterfall and output console for modes with their own visualizations
+ document.querySelector('.waterfall-container').style.display = (mode === 'satellite' || mode === 'listening' || mode === 'aircraft') ? 'none' : 'block';
+ document.getElementById('output').style.display = (mode === 'satellite' || mode === 'aircraft') ? 'none' : 'block';
document.querySelector('.status-bar').style.display = (mode === 'satellite') ? 'none' : 'flex';
// Load interfaces and initialize visualizations when switching modes
@@ -4527,29 +4554,37 @@
// Start WiFi scan - auto-enables monitor mode if needed
async function startWifiScan() {
+ console.log('startWifiScan called');
const band = document.getElementById('wifiBand').value;
const channel = document.getElementById('wifiChannel').value;
// Auto-enable monitor mode if not already enabled
if (!monitorInterface) {
const iface = document.getElementById('wifiInterfaceSelect').value;
+ console.log('Selected interface:', iface);
+
if (!iface) {
- showNotification('WiFi Error', 'No WiFi interface selected');
+ showNotification('WiFi Error', 'No WiFi interface selected. Please select an adapter from the dropdown.');
+ alert('No WiFi interface selected. Please select an adapter from the dropdown above.');
return;
}
// Show status
document.getElementById('statusText').textContent = 'Enabling monitor mode...';
document.getElementById('statusDot').classList.add('running');
+ showNotification('WiFi', 'Enabling monitor mode on ' + iface + '...');
try {
const killProcesses = document.getElementById('killProcesses').checked;
+ console.log('Enabling monitor mode, kill processes:', killProcesses);
+
const monitorResp = await fetch('/wifi/monitor', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({interface: iface, action: 'start', kill_processes: killProcesses})
});
const monitorData = await monitorResp.json();
+ console.log('Monitor response:', monitorData);
if (monitorData.status === 'success') {
monitorInterface = monitorData.monitor_interface;
@@ -4559,18 +4594,22 @@
document.getElementById('statusText').textContent = 'Idle';
document.getElementById('statusDot').classList.remove('running');
showNotification('Monitor Error', monitorData.message || 'Failed to enable monitor mode');
+ alert('Monitor mode failed: ' + (monitorData.message || 'Unknown error'));
return;
}
} catch (err) {
+ console.error('Monitor mode error:', err);
document.getElementById('statusText').textContent = 'Idle';
document.getElementById('statusDot').classList.remove('running');
showNotification('Monitor Error', err.message);
+ alert('Monitor mode error: ' + err.message);
return;
}
}
// Now start the scan
document.getElementById('statusText').textContent = 'Starting scan...';
+ console.log('Starting scan on', monitorInterface);
try {
const scanResp = await fetch('/wifi/scan/start', {
@@ -4583,6 +4622,7 @@
})
});
const scanData = await scanResp.json();
+ console.log('Scan response:', scanData);
if (scanData.status === 'started') {
setWifiRunning(true);
@@ -4592,11 +4632,14 @@
document.getElementById('statusText').textContent = 'Idle';
document.getElementById('statusDot').classList.remove('running');
showNotification('Scan Error', scanData.message || 'Failed to start scan');
+ alert('Scan failed: ' + (scanData.message || 'Unknown error'));
}
} catch (err) {
+ console.error('Scan error:', err);
document.getElementById('statusText').textContent = 'Idle';
document.getElementById('statusDot').classList.remove('running');
showNotification('Scan Error', err.message);
+ alert('Scan error: ' + err.message);
}
}
@@ -6934,6 +6977,8 @@
requestAnimationFrame(() => {
updateAdsbStats();
updateAircraftMarkers();
+ updateAircraftListPanel();
+ updateSelectedAircraftInfo();
// Batch output updates - only show last 10 to prevent DOM explosion
const toOutput = pendingAircraftData.slice(-10);
pendingAircraftData = [];
@@ -6988,6 +7033,97 @@
document.getElementById('icaoCount').textContent = count;
}
+ // Update aircraft list panel in main tab
+ function updateAircraftListPanel() {
+ const listPanel = document.getElementById('aircraftListPanel');
+ if (!listPanel) return;
+
+ const aircraft = Object.entries(adsbAircraft)
+ .filter(([_, a]) => a.lat != null && a.lon != null)
+ .sort((a, b) => (b[1].altitude || 0) - (a[1].altitude || 0))
+ .slice(0, 20);
+
+ if (aircraft.length === 0) {
+ listPanel.innerHTML = '
No aircraft detected
';
+ return;
+ }
+
+ listPanel.innerHTML = aircraft.map(([icao, a]) => {
+ const isSelected = selectedMainAircraft === icao;
+ const militaryInfo = isMilitaryAircraft ? isMilitaryAircraft(icao, a.callsign) : { military: false };
+ const bgColor = isSelected ? 'rgba(0, 212, 255, 0.2)' : 'transparent';
+ const borderColor = isSelected ? 'var(--accent-cyan)' : 'var(--border-color)';
+ const typeColor = militaryInfo.military ? '#556b2f' : 'var(--accent-cyan)';
+
+ return `
+
+
+ ${a.callsign || icao}
+ ${a.altitude ? Math.round(a.altitude).toLocaleString() + ' ft' : '--'}
+
+
+ ${a.registration || ''} ${a.type || ''} ${militaryInfo.military ? '🎖️' : ''}
+
+
+ `;
+ }).join('');
+ }
+
+ // Select an aircraft in main tab
+ function selectMainAircraft(icao) {
+ selectedMainAircraft = icao;
+ updateAircraftListPanel();
+ updateSelectedAircraftInfo();
+
+ // Center map on aircraft
+ const aircraft = adsbAircraft[icao];
+ if (aircraft && aircraft.lat && aircraft.lon && aircraftMap) {
+ aircraftMap.setView([aircraft.lat, aircraft.lon], 10);
+ }
+ }
+
+ // Update selected aircraft info panel
+ function updateSelectedAircraftInfo() {
+ const infoPanel = document.getElementById('selectedAircraftInfo');
+ if (!infoPanel) return;
+
+ if (!selectedMainAircraft || !adsbAircraft[selectedMainAircraft]) {
+ infoPanel.innerHTML = '
Click an aircraft to view details
';
+ return;
+ }
+
+ const a = adsbAircraft[selectedMainAircraft];
+ const militaryInfo = isMilitaryAircraft ? isMilitaryAircraft(selectedMainAircraft, a.callsign) : { military: false };
+
+ infoPanel.innerHTML = `
+
+
${a.callsign || selectedMainAircraft}
+ ${a.registration ? `
${a.registration}
` : ''}
+ ${militaryInfo.military ? '
🎖️ MILITARY
' : ''}
+
+
+
+
ALTITUDE
+
${a.altitude ? Math.round(a.altitude).toLocaleString() + ' ft' : '--'}
+
+
+
SPEED
+
${a.speed ? Math.round(a.speed) + ' kts' : '--'}
+
+
+
HEADING
+
${a.heading ? Math.round(a.heading) + '°' : '--'}
+
+
+
SQUAWK
+
${a.squawk || '--'}
+
+
+ ${a.type ? `
Aircraft: ${a.type}
` : ''}
+
ICAO: ${selectedMainAircraft}
+ `;
+ }
+
function addAircraftToOutput(aircraft) {
const output = document.getElementById('output');
const placeholder = output.querySelector('.placeholder');