Fix jwt-token

This commit is contained in:
2025-09-18 05:39:39 +02:00
parent 6d66d8d772
commit db8042e303

View File

@@ -65,9 +65,14 @@ class AlertService {
// Adjust threat level based on drone type and category // Adjust threat level based on drone type and category
if (droneTypeInfo.category.includes('Military') && droneTypeInfo.name !== 'Unknown') { if (droneTypeInfo.category.includes('Military') && droneTypeInfo.name !== 'Unknown') {
// Special handling for known military drones - only escalate if not at extreme distance // Military drones are always critical threat regardless of distance
if (rssi >= -85 && (droneTypeInfo.name === 'Orlan' || droneTypeInfo.name === 'Zala' || droneTypeInfo.name === 'Eleron')) { if (droneTypeInfo.name === 'Orlan' || droneTypeInfo.name === 'Zala' || droneTypeInfo.name === 'Eleron') {
// Military drones within reasonable detection range get escalated threatLevel = 'critical';
description = `CRITICAL THREAT: ${droneTypeInfo.name.toUpperCase()} MILITARY DRONE - IMMEDIATE RESPONSE REQUIRED`;
actionRequired = true;
console.log(`🚨 MILITARY DRONE DETECTED: ${droneTypeInfo.name} - Escalated to CRITICAL (RSSI: ${rssi})`);
} else {
// Other military drones get escalated one level from distance-based
if (distanceBasedThreat === 'monitoring') threatLevel = 'low'; if (distanceBasedThreat === 'monitoring') threatLevel = 'low';
else if (distanceBasedThreat === 'low') threatLevel = 'medium'; else if (distanceBasedThreat === 'low') threatLevel = 'medium';
else if (distanceBasedThreat === 'medium') threatLevel = 'high'; else if (distanceBasedThreat === 'medium') threatLevel = 'high';
@@ -76,10 +81,6 @@ class AlertService {
description = `MILITARY THREAT: ${droneTypeInfo.name.toUpperCase()} DETECTED - ENHANCED RESPONSE REQUIRED`; description = `MILITARY THREAT: ${droneTypeInfo.name.toUpperCase()} DETECTED - ENHANCED RESPONSE REQUIRED`;
actionRequired = (threatLevel !== 'low' && threatLevel !== 'monitoring'); actionRequired = (threatLevel !== 'low' && threatLevel !== 'monitoring');
console.log(`🚨 MILITARY DRONE DETECTED: ${droneTypeInfo.name} - Escalated to ${threatLevel} (RSSI: ${rssi})`); console.log(`🚨 MILITARY DRONE DETECTED: ${droneTypeInfo.name} - Escalated to ${threatLevel} (RSSI: ${rssi})`);
} else {
// For very distant military drones (RSSI < -85), preserve distance-based assessment
description += ` - ${droneTypeInfo.name.toUpperCase()} MILITARY DRONE DETECTED (DISTANT)`;
console.log(`🚨 MILITARY DRONE DETECTED: ${droneTypeInfo.name} - Using distance-based threat level: ${threatLevel} (RSSI: ${rssi})`);
} }
} else if (droneTypeInfo.threat_level === 'high' || droneTypeInfo.category.includes('Professional')) { } else if (droneTypeInfo.threat_level === 'high' || droneTypeInfo.category.includes('Professional')) {
// Professional/Commercial drone - escalate threat one level from distance-based // Professional/Commercial drone - escalate threat one level from distance-based