From 57488181152868e63384338420561428ce02bd8d Mon Sep 17 00:00:00 2001 From: Nurseit Date: Mon, 17 Nov 2025 02:42:29 +0600 Subject: [PATCH 1/2] Add elapsed time in pending status Add hours to represent Resolve changes from review Show time started on hover --- src/templates.rs | 13 ++++++- templates/queue.html | 91 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 100 insertions(+), 4 deletions(-) diff --git a/src/templates.rs b/src/templates.rs index bf25186f..c15646ca 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -1,4 +1,6 @@ -use crate::database::{MergeableState::*, PullRequestModel, QueueStatus, TreeState}; +use crate::database::{ + BuildModel, BuildStatus, MergeableState::*, PullRequestModel, QueueStatus, TreeState, +}; use askama::Template; use axum::response::{Html, IntoResponse, Response}; use http::StatusCode; @@ -70,3 +72,12 @@ pub struct QueueTemplate { #[derive(Template)] #[template(path = "not_found.html")] pub struct NotFoundTemplate {} + +pub fn get_pending_build(pr: &PullRequestModel) -> Option<&BuildModel> { + if let Some(auto_build) = &pr.auto_build + && auto_build.status == BuildStatus::Pending + { + return Some(auto_build); + } + None +} diff --git a/templates/queue.html b/templates/queue.html index 26bd5612..876f3105 100644 --- a/templates/queue.html +++ b/templates/queue.html @@ -6,6 +6,22 @@