diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx index f78e3f7..c099508 100644 --- a/client/src/pages/Dashboard.jsx +++ b/client/src/pages/Dashboard.jsx @@ -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 */}

- Detections Timeline (24h) + {t('dashboard.detectionsTimeline24h')}

@@ -236,7 +236,7 @@ const Dashboard = () => { {deviceActivity.length > 0 && (

- Device Activity (24h) + {t('dashboard.deviceActivity24h')}

@@ -262,7 +262,7 @@ const Dashboard = () => { {/* Recent Activity */}
-

Recent Activity

+

{t('dashboard.recentActivity')}

{recentActivity.map((activity, index) => ( @@ -274,9 +274,9 @@ const Dashboard = () => {

{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} )}

@@ -288,7 +288,7 @@ const Dashboard = () => { ))} {recentActivity.length === 0 && (

- No recent activity + {t('dashboard.noRecentActivity')}
)}
@@ -297,14 +297,14 @@ const Dashboard = () => { {/* Real-time Detections */}
-

Live Detections

+

{t('dashboard.liveDetections')}

- {connected ? 'Live' : 'Disconnected'} + {connected ? t('dashboard.live') : t('dashboard.disconnected')}
@@ -314,7 +314,7 @@ const Dashboard = () => {

- Drone {detection.drone_id} detected + {t('dashboard.droneDetected')} {detection.drone_id}

{detection.device.name || `Device ${detection.device_id}`} • @@ -330,7 +330,7 @@ const Dashboard = () => { ))} {recentDetections.length === 0 && (

- No recent detections + {t('dashboard.noRecentDetections')}
)}
@@ -346,7 +346,7 @@ const Dashboard = () => { {/* Movement Summary Stats */}

- Movement Tracking + {t('dashboard.movementTracking')}

diff --git a/client/src/utils/tempTranslations.js b/client/src/utils/tempTranslations.js index 9b9aacb..275d40b 100644 --- a/client/src/utils/tempTranslations.js +++ b/client/src/utils/tempTranslations.js @@ -12,8 +12,9 @@ const translations = { }, dashboard: { title: 'System Overview', - online: 'Connected', - offline: 'Disconnected', + online: 'Online', + offline: 'Offline', + inactive: 'Inactive', recentDetections: 'Recent Detections', systemHealth: 'System Health', connectedDevices: 'Connected Devices', @@ -26,9 +27,48 @@ const translations = { notificationsDisabled: 'Notifications Disabled', detectionHistory: 'Detection History', deviceStatus: 'Device Status', + deviceActivity: 'Device Activity', + deviceActivity24h: 'Device Activity (24h)', + detectionsTimeline24h: 'Detections Timeline (24h)', lastHour: 'Last Hour', last24Hours: 'Last 24 Hours', - thisWeek: 'This Week' + thisWeek: 'This Week', + connected: 'Connected', + disconnected: 'Disconnected', + healthy: 'Healthy', + warning: 'Warning', + critical: 'Critical', + operational: 'Operational', + maintenance: 'Maintenance', + failed: 'Failed', + pending: 'Pending', + approved: 'Approved', + rejected: 'Rejected', + active: 'Active', + disabled: 'Disabled', + statistics: 'Statistics', + overview: 'Overview', + summary: 'Summary', + quickStats: 'Quick Statistics', + systemOverview: 'System Overview', + recentActivity: 'Recent Activity', + liveDetections: 'Live Detections', + live: 'Live', + noRecentActivity: 'No recent activity', + noRecentDetections: 'No recent detections', + droneDetected: 'Drone detected', + heartbeatFrom: 'Heartbeat from', + movementTracking: 'Movement Tracking', + criticalAlerts: 'Critical Alerts', + veryCloseApproaches: 'Very close approaches', + highPriority: 'High Priority', + approachingDrones: 'Approaching drones', + mediumPriority: 'Medium Priority', + movementChanges: 'Movement changes', + totalTracked: 'Total Tracked', + events: 'events', + lastAlert: 'Last Alert', + none: 'None' }, detections: { title: 'Drone Detections', @@ -221,8 +261,9 @@ const translations = { }, dashboard: { title: 'Systemöversikt', - online: 'Ansluten', - offline: 'Frånkopplad', + online: 'Online', + offline: 'Offline', + inactive: 'Inaktiv', recentDetections: 'Senaste detekteringar', systemHealth: 'Systemhälsa', connectedDevices: 'Anslutna enheter', @@ -235,9 +276,48 @@ const translations = { notificationsDisabled: 'Aviseringar inaktiverade', detectionHistory: 'Detekteringshistorik', deviceStatus: 'Enhetsstatus', + deviceActivity: 'Enhetsaktivitet', + deviceActivity24h: 'Enhetsaktivitet (24h)', + detectionsTimeline24h: 'Detekteringshistorik (24h)', lastHour: 'Senaste timmen', last24Hours: 'Senaste 24 timmarna', - thisWeek: 'Denna vecka' + thisWeek: 'Denna vecka', + connected: 'Ansluten', + disconnected: 'Frånkopplad', + healthy: 'Frisk', + warning: 'Varning', + critical: 'Kritisk', + operational: 'Operativ', + maintenance: 'Underhåll', + failed: 'Misslyckad', + pending: 'Väntar', + approved: 'Godkänd', + rejected: 'Avvisad', + active: 'Aktiv', + disabled: 'Inaktiverad', + statistics: 'Statistik', + overview: 'Översikt', + summary: 'Sammanfattning', + quickStats: 'Snabbstatistik', + systemOverview: 'Systemöversikt', + recentActivity: 'Senaste aktivitet', + liveDetections: 'Live-detekteringar', + live: 'Live', + noRecentActivity: 'Ingen senaste aktivitet', + noRecentDetections: 'Inga senaste detekteringar', + droneDetected: 'Drönare detekterad', + heartbeatFrom: 'Heartbeat från', + movementTracking: 'Rörelsespårning', + criticalAlerts: 'Kritiska larm', + veryCloseApproaches: 'Mycket nära närmanden', + highPriority: 'Hög prioritet', + approachingDrones: 'Närmande drönare', + mediumPriority: 'Medel prioritet', + movementChanges: 'Rörelseförändringar', + totalTracked: 'Totalt spårade', + events: 'händelser', + lastAlert: 'Senaste larm', + none: 'Ingen' }, detections: { title: 'Drönaredetekteringar',