From 3127798e6987e04c6676d8d8c09c6564f70ccee3 Mon Sep 17 00:00:00 2001 From: Rune Morling Date: Sun, 22 Sep 2024 00:41:18 +0200 Subject: [PATCH 1/2] task info card: Add builder info Signed-off-by: Rune Morling --- views/tasks/info.dt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/views/tasks/info.dt b/views/tasks/info.dt index 020617f..240db3d 100644 --- a/views/tasks/info.dt +++ b/views/tasks/info.dt @@ -9,6 +9,9 @@ table.table.table-borderless.table-responsive th Status td include tasks/status + tr + th Builder + td=task.allocatedBuilder tr th Architecture td: span.badge=task.architecture From 6745a7d0b38ece527ac24c309f149faa8fb7f49a Mon Sep 17 00:00:00 2001 From: Rune Morling Date: Sun, 22 Sep 2024 00:40:29 +0200 Subject: [PATCH 2/2] tasks.js: Add duration and builder name Signed-off-by: Rune Morling --- static/tasks.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/tasks.js b/static/tasks.js index f7f9b09..da6b4fb 100644 --- a/static/tasks.js +++ b/static/tasks.js @@ -46,7 +46,15 @@ export function renderTask(task) const ended = task.tsEnded != 0 ? new Date(task.tsEnded * 1000).toLocaleString() : "--"; const status = renderStatus(task.status); - const timestamp = task.tsEnded != 0 ? "Ended @ " + ended : "Started @ " + started; + if (task.tsEnded != 0) { + const difference = started - ended; + //Arrange the difference of date in hours, minutes, and seconds format + const hours = Math.floor((difference / (1000 * 60 * 60))); + const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = Math.floor((difference % (1000 * 60)) / 1000); + const duration = hours + "h" + minutes + "m" + seconds + "s"; + } + const timestamp = task.tsEnded != 0 ? "Ended @ " + ended + " (" + duration + " on " + task.allocatedBuilder + ")" : "Started @ " + started + " on " + task.allocatedBuilder; return `