Fix jwt-token

This commit is contained in:
2025-09-23 09:26:18 +02:00
parent f3b2c0c7ba
commit 3412aadb9c
6 changed files with 494 additions and 94 deletions

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import api from '../services/api';
import { format } from 'date-fns';
import { t } from '../utils/tempTranslations';
import { useTranslation } from '../utils/tempTranslations';
import {
PlusIcon,
BellIcon,
@@ -16,6 +16,7 @@ import { EditAlertModal, DetectionDetailsModal } from '../components/AlertModals
import { useDroneTypes } from '../hooks/useDroneTypes';
const Alerts = () => {
const { t } = useTranslation();
// Drone types hook for dynamic drone type data
const { getDroneTypeInfo: getDroneTypeInfoFromAPI, loading: droneTypesLoading } = useDroneTypes();
@@ -110,7 +111,7 @@ const Alerts = () => {
};
const handleDeleteRule = async (ruleId) => {
if (window.confirm('Are you sure you want to delete this alert rule?')) {
if (window.confirm(t('alerts.deleteRule') + '?')) {
try {
await api.delete(`/alerts/rules/${ruleId}`);
fetchAlertData();
@@ -233,7 +234,7 @@ const Alerts = () => {
<div className="flex items-center justify-center h-64">
<div className="animate-spin rounded-full h-32 w-32 border-b-2 border-primary-600"></div>
<span className="ml-4 text-gray-600">
{droneTypesLoading ? 'Loading drone types...' : t('alerts.loading')}
{droneTypesLoading ? t('common.loading') : t('alerts.loading')}
</span>
</div>
);