From 32326d842fee6bbc266be30f82e9b81a4d88591d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 19 Sep 2025 18:11:40 +0200 Subject: [PATCH] Estimate when requests will end in the new status page --- database/src/lib.rs | 4 + site/frontend/src/pages/status_new/data.ts | 1 + site/frontend/src/pages/status_new/page.vue | 9 +- site/src/api.rs | 2 + site/src/request_handlers/status_page_new.rs | 103 +++++++++++++++---- 5 files changed, 99 insertions(+), 20 deletions(-) diff --git a/database/src/lib.rs b/database/src/lib.rs index 9633044bc..06ec0f5b7 100644 --- a/database/src/lib.rs +++ b/database/src/lib.rs @@ -1034,6 +1034,10 @@ impl BenchmarkRequest { pub fn is_completed(&self) -> bool { matches!(self.status, BenchmarkRequestStatus::Completed { .. }) } + + pub fn is_in_progress(&self) -> bool { + matches!(self.status, BenchmarkRequestStatus::InProgress { .. }) + } } /// Cached information about benchmark requests in the DB diff --git a/site/frontend/src/pages/status_new/data.ts b/site/frontend/src/pages/status_new/data.ts index 27b9aa81b..1ef129c9f 100644 --- a/site/frontend/src/pages/status_new/data.ts +++ b/site/frontend/src/pages/status_new/data.ts @@ -8,6 +8,7 @@ export type BenchmarkRequest = { requestType: BenchmarkRequestType; createdAt: string; completedAt: string | null; + endEstimated: boolean; durationS: number | null; errors: Dict; }; diff --git a/site/frontend/src/pages/status_new/page.vue b/site/frontend/src/pages/status_new/page.vue index a1c3ed4b6..7d7b77e01 100644 --- a/site/frontend/src/pages/status_new/page.vue +++ b/site/frontend/src/pages/status_new/page.vue @@ -158,8 +158,13 @@ loadStatusData(loading); req.status === "Completed" && req.hasPendingJobs ? "*" : "" }} - - + + {{ formatISODate(req.completedAt) }} + (est.) + + + {{ getDuration(req) }} +