diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1f718bf..9cc1d1d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,5 +1,4 @@ import { BrowserRouter, Routes, Route, Link, useLocation } from 'react-router-dom'; -import { useMetrics } from './hooks/useMetrics'; import { DetectionsList } from './components/DetectionsList'; import { DetailsView } from './components/DetailsView'; import { InvestigationView } from './components/InvestigationView'; @@ -11,221 +10,20 @@ import { ThreatIntelView } from './components/ThreatIntelView'; import { CorrelationGraph } from './components/CorrelationGraph'; import { InteractiveTimeline } from './components/InteractiveTimeline'; -// Composant Dashboard -function Dashboard() { - const { data, loading, error } = useMetrics(); - - if (loading) { - return ( -
-
Chargement...
-
- ); - } - - if (error) { - return ( -
-

Erreur: {error.message}

-
- ); - } - - if (!data) return null; - - const { summary } = data; - - return ( -
- {/* Métriques */} -
- - - - -
- - {/* Répartition par menace */} -
-

Répartition par Menace

-
- - - - -
-
- - {/* Série temporelle */} -
-

Évolution (24h)

- -
- - {/* Accès rapide */} -
-

Accès Rapide

-
- -

Voir les détections

-

Explorer toutes les détections

- - -

Menaces Critiques

-

{summary.critical_count} détections

- - -

Modèle Complet

-

Avec données TCP/TLS

- -
-
-
- ); -} - -// Composant MetricCard -function MetricCard({ title, value, subtitle, color }: { - title: string; - value: string | number; - subtitle: string; - color: string; -}) { - return ( -
-

{title}

-

{value}

-

{subtitle}

-
- ); -} - -// Composant ThreatBar -function ThreatBar({ level, count, total, color }: { - level: string; - count: number; - total: number; - color: string; -}) { - const percentage = total > 0 ? ((count / total) * 100).toFixed(1) : '0'; - - const colors: Record = { - CRITICAL: 'bg-threat-critical', - HIGH: 'bg-threat-high', - MEDIUM: 'bg-threat-medium', - LOW: 'bg-threat-low', - }; - - return ( -
-
- {level} - {count} ({percentage}%) -
-
-
-
-
- ); -} - -// Composant TimeSeriesChart (simplifié) -function TimeSeriesChart({ data }: { data: { hour: string; total: number }[] }) { - if (!data || data.length === 0) return null; - - const maxVal = Math.max(...data.map(d => d.total), 1); - - return ( -
- {data.map((point, i) => { - const height = (point.total / maxVal) * 100; - const hour = new Date(point.hour).getHours(); - - return ( -
-
- {i % 4 === 0 && ( - {hour}h - )} -
- ); - })} -
- ); -} - // Navigation function Navigation() { const location = useLocation(); const links = [ - { path: '/incidents', label: '🚨 Incidents' }, - { path: '/', label: '📊 Dashboard' }, - { path: '/detections', label: '📋 Détections' }, - { path: '/threat-intel', label: '📚 Threat Intel' }, + { path: '/', label: 'Incidents' }, + { path: '/threat-intel', label: 'Threat Intel' }, ]; return (