From ede63782411b80a93a476744d67e81e251ea2bf0 Mon Sep 17 00:00:00 2001 From: marco370 <48531002-marco370@users.noreply.replit.com> Date: Mon, 24 Nov 2025 08:57:07 +0000 Subject: [PATCH] Update analytics to show hourly data and time Fix an issue where historical analytics were not displaying correctly by changing the data fetch to hourly and updating the date format. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 49cfc935-92d3-4961-b703-750d52c8bdc2 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/37PFEyl --- .replit | 4 ++++ client/src/pages/AnalyticsHistory.tsx | 4 ++-- replit.md | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.replit b/.replit index 5c190e2..f8d4770 100644 --- a/.replit +++ b/.replit @@ -22,6 +22,10 @@ externalPort = 3002 localPort = 43803 externalPort = 3000 +[[ports]] +localPort = 45209 +externalPort = 3001 + [env] PORT = "5000" diff --git a/client/src/pages/AnalyticsHistory.tsx b/client/src/pages/AnalyticsHistory.tsx index 0dd4edd..0a2e176 100644 --- a/client/src/pages/AnalyticsHistory.tsx +++ b/client/src/pages/AnalyticsHistory.tsx @@ -16,7 +16,7 @@ export default function AnalyticsHistory() { // Fetch historical analytics (daily aggregations) const { data: analytics = [], isLoading } = useQuery({ - queryKey: ["/api/analytics/recent", { days, hourly: false }], + queryKey: ["/api/analytics/recent", { days, hourly: true }], refetchInterval: 60000, // Aggiorna ogni minuto }); @@ -36,7 +36,7 @@ export default function AnalyticsHistory() { } catch {} return { - date: format(new Date(a.date), "dd/MM"), + date: format(new Date(a.date), "dd/MM HH:mm"), fullDate: a.date, totalPackets: a.totalPackets || 0, normalPackets: a.normalPackets || 0, diff --git a/replit.md b/replit.md index 0493829..a27ece0 100644 --- a/replit.md +++ b/replit.md @@ -63,6 +63,7 @@ The IDS employs a React-based frontend for real-time monitoring, detection visua - **Deploy**: Migration 005 + `./deployment/setup_analytics_timer.sh` - **Security Fix**: Rimosso hardcoded path, implementato wrapper script sicuro `run_analytics.sh` per esecuzioni manuali - **Production-grade**: Credenziali gestite via systemd EnvironmentFile (automatico) o wrapper script (manuale) +- **Frontend Fix**: Analytics History ora usa dati orari (`hourly: true`) finché aggregazione daily non è schedulata ### 🌍 IP Geolocation Integration (22 Nov 2025 - 13:00) - **Feature**: Informazioni geografiche complete (paese, città, organizzazione, AS) per ogni IP