From a43042fac1136ccd5502aca801872c7721b761d7 Mon Sep 17 00:00:00 2001 From: wisecolt Date: Sun, 18 Jan 2026 17:28:10 +0300 Subject: [PATCH] =?UTF-8?q?feat(ui):=20birle=C5=9Fik=20metrik=20hesaplamas?= =?UTF-8?q?=C4=B1=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit İş ve deployment istatistiklerini birleştirerek toplam koşu sayısı ve başarı oranı göstergelerini güncelle. Son çalışma süresi hesaplamasını activityItems kullanacak şekilde düzelt. --- frontend/src/pages/HomePage.tsx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index f25f6a3..ae98ef3 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -150,7 +150,24 @@ export function HomePage() { .slice(0, 10); }, [mergedRuns, deployRuns]); - const lastRunDuration = useMemo(() => formatDuration(mergedRuns[0]?.durationMs), [mergedRuns]); + const combinedTotals = useMemo(() => { + const jobSuccess = metrics?.dailyStats.reduce((acc, d) => acc + (d.success || 0), 0) ?? 0; + const jobTotal = metrics?.dailyStats.reduce((acc, d) => acc + (d.total || 0), 0) ?? 0; + const deploySuccess = + deploymentMetrics?.dailyStats.reduce((acc, d) => acc + (d.success || 0), 0) ?? 0; + const deployTotal = + deploymentMetrics?.dailyStats.reduce((acc, d) => acc + (d.total || 0), 0) ?? 0; + const totalRuns = jobTotal + deployTotal; + const successRate = totalRuns + ? Math.round(((jobSuccess + deploySuccess) / totalRuns) * 100) + : 0; + return { totalRuns, successRate }; + }, [metrics, deploymentMetrics]); + + const lastRunDuration = useMemo(() => { + const latest = activityItems[0]; + return formatDuration(latest?.durationMs); + }, [activityItems]); return (
@@ -163,7 +180,7 @@ export function HomePage() {
- {metrics?.totals.totalRuns ?? 0} toplam koşu + {combinedTotals.totalRuns} toplam koşu
@@ -210,13 +227,13 @@ export function HomePage() {
Başarı Oranı - {metrics?.totals.successRate ?? 0}% + {combinedTotals.successRate}%
Toplam Çalıştırma - {metrics?.totals.totalRuns ?? 0} + {combinedTotals.totalRuns}
-- 2.49.1