feat(Dashboard): display average ping response time in PingServiceCard based on historical data
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 3m7s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 3m7s
This commit is contained in:
@@ -157,6 +157,15 @@ function PingServiceCard({ config, ms, previousMs, history = [], loading, isExpa
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{history.length > 0 && (() => {
|
||||
const sum = history.reduce((a, b) => a + b, 0);
|
||||
const avg = Math.round(sum / history.length);
|
||||
return (
|
||||
<div className="text-muted small mb-2">
|
||||
Среднее за период: <span className="fw-semibold text-body">{avg} мс</span>
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
{history.length > 0 ? (
|
||||
<PingSparklineWrap history={history} color={color} />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user