From f406342b539a52a9a0dd2995c83d20d2cface597 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Mon, 16 Mar 2026 18:19:19 +0100 Subject: [PATCH] update latency modal --- AppImage/components/latency-detail-modal.tsx | 45 ++++++++++++++++---- AppImage/scripts/flask_server.py | 31 ++++++-------- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/AppImage/components/latency-detail-modal.tsx b/AppImage/components/latency-detail-modal.tsx index bd324da3..968f6fae 100644 --- a/AppImage/components/latency-detail-modal.tsx +++ b/AppImage/components/latency-detail-modal.tsx @@ -63,21 +63,46 @@ interface LatencyDetailModalProps { const CustomTooltip = ({ active, payload, label }: any) => { if (active && payload && payload.length) { const entry = payload[0] - const packetLoss = entry?.payload?.packet_loss + const data = entry?.payload + const packetLoss = data?.packet_loss + const hasMinMax = data?.min !== undefined && data?.max !== undefined && data?.min !== data?.max + return (

{label}

-
-
- Latency: - {entry.value} ms -
+ {hasMinMax ? ( + // Show min/avg/max when downsampled data is available + <> +
+
+ Min: + {data.min} ms +
+
+
+ Avg: + {data.value} ms +
+
+
+ Max: + {data.max} ms +
+ + ) : ( + // Simple latency display for single data points +
+
+ Latency: + {entry.value} ms +
+ )} {packetLoss !== undefined && packetLoss > 0 && (
-
+
Pkt Loss: - {packetLoss}% + {packetLoss}%
)}
@@ -1083,9 +1108,11 @@ export function LatencyDetailModal({ open, onOpenChange, currentLatency }: Laten tickFormatter={(v) => `${Number(v).toFixed(1)}ms`} /> } /> + {/* For longer timeframes (6h+), show max values to preserve spikes. + For 1 hour view, show avg values since there's no downsampling */}