From 484dd56312f147636575dce3d8d918ad4d341538 Mon Sep 17 00:00:00 2001 From: shats Date: Sun, 22 Feb 2026 21:50:53 +0700 Subject: [PATCH] feat(Dashboard): display average ping response time in PingServiceCard based on historical data --- frontend/src/Dashboard.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/Dashboard.jsx b/frontend/src/Dashboard.jsx index 8135843..ad029a8 100644 --- a/frontend/src/Dashboard.jsx +++ b/frontend/src/Dashboard.jsx @@ -157,6 +157,15 @@ function PingServiceCard({ config, ms, previousMs, history = [], loading, isExpa /> )} + {history.length > 0 && (() => { + const sum = history.reduce((a, b) => a + b, 0); + const avg = Math.round(sum / history.length); + return ( +
+ Среднее за период: {avg} мс +
+ ); + })()} {history.length > 0 ? ( ) : (