Fix jwt-token

This commit is contained in:
2025-09-23 12:42:34 +02:00
parent fe30501621
commit 521ee52398
2 changed files with 42 additions and 3 deletions

View File

@@ -173,6 +173,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
{t('alerts.priority')} {t('alerts.priority')}
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Determines alert urgency and notification routing
</div>
<select <select
name="priority" name="priority"
className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500" className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500"
@@ -190,6 +193,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
{t('alerts.minThreatLevel')} {t('alerts.minThreatLevel')}
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Only alert on drones at or above this threat level
</div>
<select <select
name="min_threat_level" name="min_threat_level"
className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500" className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500"
@@ -210,10 +216,10 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-2"> <label className="block text-sm font-medium text-gray-700 mb-2">
{t('alerts.form.droneTypesFilter')} {t('alerts.form.droneTypesFilter')}
</label> </label>
<div className="text-xs text-gray-500 mb-2">
{t('alerts.form.leaveEmptyAllTypes')} - Select specific drone types to monitor or leave empty to monitor all detected drones
</div>
<div className="space-y-2"> <div className="space-y-2">
<div className="text-xs text-gray-500 mb-2">
{t('alerts.form.leaveEmptyAllTypes')}
</div>
{droneTypes.map(droneType => ( {droneTypes.map(droneType => (
<label key={droneType.id} className="flex items-center"> <label key={droneType.id} className="flex items-center">
<input <input
@@ -236,6 +242,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Min Detections Min Detections
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Number of detections required within time window to trigger alert
</div>
<input <input
type="number" type="number"
name="min_detections" name="min_detections"
@@ -250,6 +259,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Time Window (seconds) Time Window (seconds)
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Time period to count detections (e.g., 3 detections in 300 seconds)
</div>
<input <input
type="number" type="number"
name="time_window" name="time_window"
@@ -265,6 +277,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Cooldown Period (seconds) Cooldown Period (seconds)
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Minimum time between alerts to prevent spam (0 = no cooldown)
</div>
<input <input
type="number" type="number"
name="cooldown_period" name="cooldown_period"
@@ -279,6 +294,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
<label className="block text-sm font-medium text-gray-700 mb-2"> <label className="block text-sm font-medium text-gray-700 mb-2">
Alert Channels Alert Channels
</label> </label>
<div className="text-xs text-gray-500 mb-2">
Choose how you want to receive alerts when this rule is triggered
</div>
<div className="space-y-2"> <div className="space-y-2">
{['sms', 'email', 'webhook'].map(channel => ( {['sms', 'email', 'webhook'].map(channel => (
<label key={channel} className="flex items-center"> <label key={channel} className="flex items-center">
@@ -290,6 +308,9 @@ export const EditAlertModal = ({ rule, onClose, onSuccess }) => {
/> />
<span className="ml-2 text-sm text-gray-700 capitalize"> <span className="ml-2 text-sm text-gray-700 capitalize">
{channel} {channel}
{channel === 'sms' && <span className="text-xs text-gray-400 ml-1">(Text message)</span>}
{channel === 'email' && <span className="text-xs text-gray-400 ml-1">(Email notification)</span>}
{channel === 'webhook' && <span className="text-xs text-gray-400 ml-1">(HTTP POST to URL)</span>}
</span> </span>
</label> </label>
))} ))}

View File

@@ -970,6 +970,9 @@ const CreateAlertRuleModal = ({ onClose, onSave }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Priority Priority
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Determines alert urgency and notification routing
</div>
<select <select
name="priority" name="priority"
className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500" className="w-full border border-gray-300 rounded-md px-3 py-2 focus:ring-primary-500 focus:border-primary-500"
@@ -987,6 +990,9 @@ const CreateAlertRuleModal = ({ onClose, onSave }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Min Detections Min Detections
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Number of detections required within time window to trigger alert
</div>
<input <input
type="number" type="number"
name="min_detections" name="min_detections"
@@ -1003,6 +1009,9 @@ const CreateAlertRuleModal = ({ onClose, onSave }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Time Window (seconds) Time Window (seconds)
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Time period to count detections (e.g., 3 detections in 300 seconds)
</div>
<input <input
type="number" type="number"
name="time_window" name="time_window"
@@ -1017,6 +1026,9 @@ const CreateAlertRuleModal = ({ onClose, onSave }) => {
<label className="block text-sm font-medium text-gray-700 mb-1"> <label className="block text-sm font-medium text-gray-700 mb-1">
Cooldown Period (seconds) Cooldown Period (seconds)
</label> </label>
<div className="text-xs text-gray-500 mb-1">
Minimum time between alerts to prevent spam (0 = no cooldown)
</div>
<input <input
type="number" type="number"
name="cooldown_period" name="cooldown_period"
@@ -1032,6 +1044,9 @@ const CreateAlertRuleModal = ({ onClose, onSave }) => {
<label className="block text-sm font-medium text-gray-700 mb-2"> <label className="block text-sm font-medium text-gray-700 mb-2">
Alert Channels Alert Channels
</label> </label>
<div className="text-xs text-gray-500 mb-2">
Choose how you want to receive alerts when this rule is triggered
</div>
<div className="space-y-2"> <div className="space-y-2">
{['sms', 'email', 'webhook'].map(channel => ( {['sms', 'email', 'webhook'].map(channel => (
<label key={channel} className="flex items-center"> <label key={channel} className="flex items-center">
@@ -1043,6 +1058,9 @@ const CreateAlertRuleModal = ({ onClose, onSave }) => {
/> />
<span className="ml-2 text-sm text-gray-700 capitalize"> <span className="ml-2 text-sm text-gray-700 capitalize">
{channel} {channel}
{channel === 'sms' && <span className="text-xs text-gray-400 ml-1">(Text message)</span>}
{channel === 'email' && <span className="text-xs text-gray-400 ml-1">(Email notification)</span>}
{channel === 'webhook' && <span className="text-xs text-gray-400 ml-1">(HTTP POST to URL)</span>}
</span> </span>
</label> </label>
))} ))}