diff --git a/static/js/modes/bluetooth.js b/static/js/modes/bluetooth.js index 4457a8e..d229fd3 100644 --- a/static/js/modes/bluetooth.js +++ b/static/js/modes/bluetooth.js @@ -23,8 +23,7 @@ const BluetoothMode = (function() { strong: 0, medium: 0, weak: 0, - trackers: [], - findmy: [] + trackers: [] }; // Zone counts for proximity display @@ -32,7 +31,6 @@ const BluetoothMode = (function() { // New visualization components let radarInitialized = false; - let heatmapInitialized = false; let radarPaused = false; /** @@ -60,16 +58,12 @@ const BluetoothMode = (function() { // Check scan status (in case page was reloaded during scan) checkScanStatus(); - // Initialize proximity visualization (new radar + heatmap) + // Initialize proximity visualization initProximityRadar(); - initTimelineHeatmap(); // Initialize legacy heatmap (zone counts) initHeatmap(); - // Initialize timeline as collapsed - initTimeline(); - // Set initial panel states updateVisualizationPanels(); } @@ -134,30 +128,6 @@ const BluetoothMode = (function() { } } - /** - * Initialize the timeline heatmap component - */ - function initTimelineHeatmap() { - const heatmapContainer = document.getElementById('btTimelineHeatmap'); - if (!heatmapContainer) return; - - if (typeof TimelineHeatmap !== 'undefined') { - TimelineHeatmap.init('btTimelineHeatmap', { - windowMinutes: 10, - bucketSeconds: 10, - sortBy: 'recency', - onDeviceSelect: (deviceKey, device) => { - // Find device and show modal - const fullDevice = Array.from(devices.values()).find(d => d.device_key === deviceKey); - if (fullDevice) { - selectDevice(fullDevice.device_id); - } - } - }); - heatmapInitialized = true; - } - } - /** * Update the proximity radar with current devices */ @@ -391,41 +361,6 @@ const BluetoothMode = (function() { if (e.key === 'Escape') closeModal(); } - /** - * Initialize timeline as collapsed - */ - function initTimeline() { - const timelineContainer = document.getElementById('bluetoothTimelineContainer'); - if (!timelineContainer) return; - - // Check if ActivityTimeline exists and initialize it collapsed - if (typeof ActivityTimeline !== 'undefined') { - // Timeline will be initialized by the main app, but we'll collapse it - setTimeout(() => { - const timeline = timelineContainer.querySelector('.activity-timeline'); - if (timeline) { - const content = timeline.querySelector('.activity-timeline-content'); - const toggleBtn = timeline.querySelector('.activity-timeline-toggle'); - if (content) content.style.display = 'none'; - if (toggleBtn) toggleBtn.textContent = '▶'; - } - }, 500); - } else { - // Create a simple placeholder - timelineContainer.innerHTML = ` -
-
- Device Activity - -
- -
- `; - } - } - /** * Select a device - opens modal with details */ @@ -604,16 +539,10 @@ const BluetoothMode = (function() { function resetStats() { deviceStats = { - phones: 0, - computers: 0, - audio: 0, - wearables: 0, - other: 0, strong: 0, medium: 0, weak: 0, - trackers: [], - findmy: [] + trackers: [] }; updateVisualizationPanels(); updateProximityZones(); @@ -668,51 +597,6 @@ const BluetoothMode = (function() { // Update new proximity radar updateRadar(); - - // Feed to activity timeline - addToTimeline(device); - } - - /** - * Add device event to timeline - */ - function addToTimeline(device) { - if (typeof addTimelineEvent === 'function') { - const normalized = { - id: device.device_id, - label: device.name || formatDeviceId(device.address), - strength: device.rssi_current ? Math.min(5, Math.max(1, Math.ceil((device.rssi_current + 100) / 20))) : 3, - duration: 1500, - type: 'bluetooth' - }; - addTimelineEvent('bluetooth', normalized); - } - - // Also update our simple timeline if it exists - const activityContent = document.getElementById('btActivityContent'); - if (activityContent) { - const time = new Date().toLocaleTimeString(); - const existing = activityContent.querySelector('.bt-activity-list'); - - if (!existing) { - activityContent.innerHTML = '
'; - } - - const list = activityContent.querySelector('.bt-activity-list'); - const entry = document.createElement('div'); - entry.style.cssText = 'padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 10px;'; - entry.innerHTML = ` - ${time} - ${escapeHtml(device.name || formatDeviceId(device.address))} - ${device.rssi_current || '--'} dBm - `; - list.insertBefore(entry, list.firstChild); - - // Keep only last 50 entries - while (list.children.length > 50) { - list.removeChild(list.lastChild); - } - } } /** @@ -724,13 +608,10 @@ const BluetoothMode = (function() { deviceStats.medium = 0; deviceStats.weak = 0; deviceStats.trackers = []; - deviceStats.findmy = []; devices.forEach(d => { - const mfr = (d.manufacturer_name || '').toLowerCase(); const name = (d.name || '').toLowerCase(); const rssi = d.rssi_current; - const flags = d.heuristic_flags || []; // Signal strength classification if (rssi != null) { @@ -749,17 +630,6 @@ const BluetoothMode = (function() { deviceStats.trackers.push(d); } } - - // FindMy detection - Apple devices with specific characteristics - // Apple manufacturer ID is 0x004C (76) - const isApple = mfr.includes('apple') || d.manufacturer_id === 76; - const hasBeaconBehavior = flags.includes('beacon_like') || flags.includes('persistent'); - - if (isApple && hasBeaconBehavior) { - if (!deviceStats.findmy.find(t => t.address === d.address)) { - deviceStats.findmy.push(d); - } - } }); } @@ -803,25 +673,6 @@ const BluetoothMode = (function() { } } - // FindMy Detection - const findmyList = document.getElementById('btFindMyList'); - if (findmyList) { - if (devices.size === 0) { - findmyList.innerHTML = '
Start scanning to detect FindMy devices
'; - } else if (deviceStats.findmy.length === 0) { - findmyList.innerHTML = '
No FindMy-compatible devices detected
'; - } else { - findmyList.innerHTML = deviceStats.findmy.map(t => ` -
-
- ${escapeHtml(t.name || 'Apple Device')} - ${t.rssi_current || '--'} dBm -
-
${t.address}
-
- `).join(''); - } - } } function updateDeviceCount() { diff --git a/templates/index.html b/templates/index.html index 66a99a9..aadc266 100644 --- a/templates/index.html +++ b/templates/index.html @@ -760,23 +760,6 @@ - -
-
Apple FindMy Network
-
-
Scanning for - FindMy-compatible devices...
-
-
- -
-
Signal History
-
-
- -
-
-