mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-07-26 11:33:12 +02:00
7802a00db3
PR #348 lowered the RAW_PACKET_RETENTION_DAYS default 7->2, but the dashboard packet count, activity chart, and breakdown chart still advertised "Last 7 days" — a label that lied once only 2 days of data remained. Make every raw-packet-derived window track the effective retention so labels stay honest: - get_dashboard_stats: packets_7d window = min(7, retention); expose packets_window_days on DashboardStats so the UI renders the real window - packet-activity / packet-breakdown: clamp days = min(days, 90, retention) so responses never advertise days whose data has been purged - Home StatCard + Dashboard chart subtitles: dynamic "Last N days" / "Per day (last N days)" via new time.last_n_days / time.per_day_last_n_days i18n keys ({{n}} interpolation, matching routes_over_last_n_days) - ActivitySeries.days made optional (type shared across activity charts); PacketBreakdown.days added (backend always serializes it) Messages/ads 7-day displays are unchanged — those draw on event data which retains the full 30-day DATA_RETENTION_DAYS window. Tests: autouse retention fixture (->90) on the three packet test classes so existing days-handling tests stay valid; added retention-clamp tests proving the window tracks retention=2 and relaxes to 7 at retention>=7.