From 2b21b8380e38f9cec6f44f8ac8d6d02321915cc0 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Mon, 18 Aug 2025 08:06:39 +0200 Subject: [PATCH] Fix jwt-token --- client/src/pages/MapView.jsx | 95 ++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 32 deletions(-) diff --git a/client/src/pages/MapView.jsx b/client/src/pages/MapView.jsx index a0f0819..c4ad9b5 100644 --- a/client/src/pages/MapView.jsx +++ b/client/src/pages/MapView.jsx @@ -303,38 +303,65 @@ const MapView = () => { ); })} - {/* Drone Detection Markers */} + {/* RSSI-based Detection Rings around Detectors */} {showDroneDetections && droneDetectionHistory .filter(detection => detection.geo_lat && detection.geo_lon) .map(detection => { const opacity = getDetectionOpacity(detection); const age = getDetectionAge(detection); + // Calculate ring radius based on RSSI (rough distance estimation) + const getRssiRadius = (rssi) => { + if (rssi > -40) return 100; // <100m - very close + if (rssi > -60) return 500; // ~500m - close + if (rssi > -70) return 1500; // ~1.5km - medium + if (rssi > -80) return 4000; // ~4km - far + if (rssi > -90) return 8000; // ~8km - very far + return 15000; // ~15km - maximum range + }; + + const radius = getRssiRadius(detection.rssi); + + // Color based on threat level and RSSI strength + const getRingColor = (rssi, droneType) => { + // Orlan drones (type 1) always red + if (droneType === 1) return '#dc2626'; // red-600 + + // Other drones based on RSSI + if (rssi > -60) return '#dc2626'; // red-600 - close + if (rssi > -70) return '#ea580c'; // orange-600 - medium + return '#16a34a'; // green-600 - far + }; + + const ringColor = getRingColor(detection.rssi, detection.drone_type); + return ( - - - - - + {/* Detection Ring around Detector (NOT drone position) */} + - {/* Detection range circle for recent detections */} - {age < 2 && ( - -60 ? '#ff4757' : '#ffa726', - fillColor: detection.rssi > -60 ? '#ff4757' : '#ffa726', - fillOpacity: 0.1 * opacity, - weight: 2, - opacity: opacity * 0.5 - }} - /> + {/* Optional: Small info marker at detector showing detection details */} + {age < 1 && ( // Only show for very recent detections (< 1 minute) + + + + + )} ); @@ -360,23 +387,27 @@ const MapView = () => { {showDroneDetections && ( <>
-
Drone Detections:
+
Drone Detection Rings:
+
Rings show estimated detection range based on RSSI
-
- Strong Signal (>-60dBm) +
+ Orlan/Military (Always Critical)
-
- Medium Signal (-60 to -70dBm) +
+ Close Range (>-60dBm)
-
- Weak Signal (<-70dBm) +
+ Medium Range (-60 to -70dBm)
-
- Detection Range +
+ Far Range (<-70dBm) +
+
+ Ring size = estimated distance from detector
)}