Fix jwt-token

This commit is contained in:
2025-09-19 14:20:37 +02:00
parent 32245f1132
commit 0c82db822c
2 changed files with 100 additions and 20 deletions

View File

@@ -109,9 +109,9 @@ const Dashboard = () => {
];
const deviceStatusData = [
{ name: 'Online', value: overview?.device_status?.online || 0, color: '#22c55e' },
{ name: 'Offline', value: overview?.device_status?.offline || 0, color: '#ef4444' },
{ name: 'Inactive', value: overview?.device_status?.inactive || 0, color: '#6b7280' }
{ name: t('dashboard.online'), value: overview?.device_status?.online || 0, color: '#22c55e' },
{ name: t('dashboard.offline'), value: overview?.device_status?.offline || 0, color: '#ef4444' },
{ name: t('dashboard.inactive'), value: overview?.device_status?.inactive || 0, color: '#6b7280' }
];
return (
@@ -165,7 +165,7 @@ const Dashboard = () => {
{/* Detection Timeline */}
<div className="bg-white p-6 rounded-lg shadow">
<h3 className="text-lg font-medium text-gray-900 mb-4">
Detections Timeline (24h)
{t('dashboard.detectionsTimeline24h')}
</h3>
<div className="h-64">
<ResponsiveContainer width="100%" height="100%">
@@ -236,7 +236,7 @@ const Dashboard = () => {
{deviceActivity.length > 0 && (
<div className="bg-white p-6 rounded-lg shadow">
<h3 className="text-lg font-medium text-gray-900 mb-4">
Device Activity (24h)
{t('dashboard.deviceActivity24h')}
</h3>
<div className="h-64">
<ResponsiveContainer width="100%" height="100%">
@@ -262,7 +262,7 @@ const Dashboard = () => {
{/* Recent Activity */}
<div className="bg-white rounded-lg shadow">
<div className="px-6 py-4 border-b border-gray-200">
<h3 className="text-lg font-medium text-gray-900">Recent Activity</h3>
<h3 className="text-lg font-medium text-gray-900">{t('dashboard.recentActivity')}</h3>
</div>
<div className="divide-y divide-gray-200 max-h-96 overflow-y-auto">
{recentActivity.map((activity, index) => (
@@ -274,9 +274,9 @@ const Dashboard = () => {
<div className="flex-1 min-w-0">
<p className="text-sm text-gray-900">
{activity.type === 'detection' ? (
<>Drone {activity.data.drone_id} detected by {activity.data.device_name}</>
<>{t('dashboard.droneDetected')} {activity.data.drone_id} {activity.data.device_name}</>
) : (
<>Heartbeat from {activity.data.device_name}</>
<>{t('dashboard.heartbeatFrom')} {activity.data.device_name}</>
)}
</p>
<p className="text-xs text-gray-500">
@@ -288,7 +288,7 @@ const Dashboard = () => {
))}
{recentActivity.length === 0 && (
<div className="px-6 py-8 text-center text-gray-500">
No recent activity
{t('dashboard.noRecentActivity')}
</div>
)}
</div>
@@ -297,14 +297,14 @@ const Dashboard = () => {
{/* Real-time Detections */}
<div className="bg-white rounded-lg shadow">
<div className="px-6 py-4 border-b border-gray-200 flex items-center justify-between">
<h3 className="text-lg font-medium text-gray-900">Live Detections</h3>
<h3 className="text-lg font-medium text-gray-900">{t('dashboard.liveDetections')}</h3>
<div className={`flex items-center space-x-2 px-2 py-1 rounded-full text-xs ${
connected ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'
}`}>
<div className={`w-2 h-2 rounded-full ${
connected ? 'bg-green-400' : 'bg-red-400'
}`} />
<span>{connected ? 'Live' : 'Disconnected'}</span>
<span>{connected ? t('dashboard.live') : t('dashboard.disconnected')}</span>
</div>
</div>
<div className="divide-y divide-gray-200 max-h-96 overflow-y-auto">
@@ -314,7 +314,7 @@ const Dashboard = () => {
<div className="flex-shrink-0 w-2 h-2 rounded-full bg-red-400 animate-pulse" />
<div className="flex-1 min-w-0">
<p className="text-sm text-gray-900">
Drone {detection.drone_id} detected
{t('dashboard.droneDetected')} {detection.drone_id}
</p>
<p className="text-xs text-gray-500">
{detection.device.name || `Device ${detection.device_id}`}
@@ -330,7 +330,7 @@ const Dashboard = () => {
))}
{recentDetections.length === 0 && (
<div className="px-6 py-8 text-center text-gray-500">
No recent detections
{t('dashboard.noRecentDetections')}
</div>
)}
</div>
@@ -346,7 +346,7 @@ const Dashboard = () => {
{/* Movement Summary Stats */}
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-medium text-gray-900 mb-4">
Movement Tracking
{t('dashboard.movementTracking')}
</h3>
<div className="space-y-4">