import { useState, useEffect } from 'react'; // ─── Types ──────────────────────────────────────────────────────────────────── interface HourlyEntry { hour: number; hits: number; unique_ips: number; max_rps: number; } interface TopHost { host: string; total_hits: number; unique_ips: number; unique_ja4s: number; hourly_hits: number[]; } interface HeatmapMatrix { hosts: string[]; matrix: number[][]; } // ─── Helpers ────────────────────────────────────────────────────────────────── function formatNumber(n: number): string { return n.toLocaleString('fr-FR'); } function heatmapCellStyle(value: number, maxValue: number): React.CSSProperties { if (maxValue === 0 || value === 0) return { backgroundColor: 'transparent' }; const ratio = value / maxValue; if (ratio >= 0.75) return { backgroundColor: 'rgba(239, 68, 68, 0.85)' }; if (ratio >= 0.5) return { backgroundColor: 'rgba(168, 85, 247, 0.7)' }; if (ratio >= 0.25) return { backgroundColor: 'rgba(59, 130, 246, 0.6)' }; if (ratio >= 0.05) return { backgroundColor: 'rgba(96, 165, 250, 0.35)' }; return { backgroundColor: 'rgba(147, 197, 253, 0.15)' }; } // ─── Sub-components ─────────────────────────────────────────────────────────── function StatCard({ label, value, accent }: { label: string; value: string | number; accent?: string }) { return (
Distribution horaire de l'activité malveillante par host cible.
Aucune donnée disponible.
) : (| Host | Total hits | IPs uniques | JA4 uniques | Activité 24h |
|---|---|---|---|---|
| {h.host} | {formatNumber(h.total_hits)} | {formatNumber(h.unique_ips)} | {formatNumber(h.unique_ja4s)} |
|