Skip to content

Commit

Permalink
tasks.js: Add duration and builder name
Browse files Browse the repository at this point in the history
Signed-off-by: Rune Morling <[email protected]>
  • Loading branch information
ermo authored and ikeycode committed Sep 22, 2024
1 parent 7e87129 commit 91307a7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion static/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `
<div class="list-group-item list-group-item-hoverable">
<div class="row align-items-center">
Expand Down

0 comments on commit 91307a7

Please sign in to comment.