Fix jwt-token
This commit is contained in:
@@ -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 (
|
||||
<React.Fragment key={detection.id}>
|
||||
{/* Detection Ring around Detector (NOT drone position) */}
|
||||
<Circle
|
||||
center={[detection.geo_lat, detection.geo_lon]} // Detector position
|
||||
radius={radius}
|
||||
pathOptions={{
|
||||
color: ringColor,
|
||||
fillColor: ringColor,
|
||||
fillOpacity: 0.05 * opacity,
|
||||
weight: detection.drone_type === 1 ? 3 : 2, // Thicker for Orlan
|
||||
opacity: opacity * 0.8,
|
||||
dashArray: detection.drone_type === 1 ? null : '5, 5' // Solid for Orlan, dashed for others
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Optional: Small info marker at detector showing detection details */}
|
||||
{age < 1 && ( // Only show for very recent detections (< 1 minute)
|
||||
<Marker
|
||||
position={[detection.geo_lat, detection.geo_lon]}
|
||||
icon={createDroneIcon(detection.rssi, detection.drone_type)}
|
||||
opacity={opacity}
|
||||
opacity={opacity * 0.7}
|
||||
>
|
||||
<Popup>
|
||||
<DroneDetectionPopup detection={detection} age={age} droneTypes={droneTypes} />
|
||||
</Popup>
|
||||
</Marker>
|
||||
|
||||
{/* Detection range circle for recent detections */}
|
||||
{age < 2 && (
|
||||
<Circle
|
||||
center={[detection.geo_lat, detection.geo_lon]}
|
||||
radius={200} // 200m detection radius
|
||||
pathOptions={{
|
||||
color: detection.rssi > -60 ? '#ff4757' : '#ffa726',
|
||||
fillColor: detection.rssi > -60 ? '#ff4757' : '#ffa726',
|
||||
fillOpacity: 0.1 * opacity,
|
||||
weight: 2,
|
||||
opacity: opacity * 0.5
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
@@ -360,23 +387,27 @@ const MapView = () => {
|
||||
{showDroneDetections && (
|
||||
<>
|
||||
<div className="border-t border-gray-200 mt-2 pt-2">
|
||||
<div className="font-medium text-gray-800 mb-1">Drone Detections:</div>
|
||||
<div className="font-medium text-gray-800 mb-1">Drone Detection Rings:</div>
|
||||
<div className="text-xs text-gray-600 mb-2">Rings show estimated detection range based on RSSI</div>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="w-3 h-3 bg-red-500 rounded-full border border-red-600 opacity-100"></div>
|
||||
<span className="text-gray-700">Strong Signal (>-60dBm)</span>
|
||||
<div className="w-3 h-3 border-2 border-red-600 rounded-full bg-red-600 bg-opacity-10"></div>
|
||||
<span className="text-gray-700">Orlan/Military (Always Critical)</span>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="w-3 h-3 bg-orange-500 rounded-full border border-orange-600 opacity-90"></div>
|
||||
<span className="text-gray-700">Medium Signal (-60 to -70dBm)</span>
|
||||
<div className="w-3 h-3 border-2 border-red-500 rounded-full bg-red-500 bg-opacity-10"></div>
|
||||
<span className="text-gray-700">Close Range (>-60dBm)</span>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="w-3 h-3 bg-green-500 rounded-full border border-green-600 opacity-80"></div>
|
||||
<span className="text-gray-700">Weak Signal (<-70dBm)</span>
|
||||
<div className="w-3 h-3 border-2 border-orange-500 rounded-full bg-orange-500 bg-opacity-10"></div>
|
||||
<span className="text-gray-700">Medium Range (-60 to -70dBm)</span>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="w-3 h-3 border-2 border-red-400 rounded-full bg-transparent"></div>
|
||||
<span className="text-gray-700">Detection Range</span>
|
||||
<div className="w-3 h-3 border-2 border-green-500 rounded-full bg-green-500 bg-opacity-10"></div>
|
||||
<span className="text-gray-700">Far Range (<-70dBm)</span>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500 mt-2">
|
||||
Ring size = estimated distance from detector
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user