Skip to content

Commit

Permalink
ui: status: link to test from crashes
Browse files Browse the repository at this point in the history
Add a URL to the test that crashed for ease of navigation.

Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed May 21, 2024
1 parent cef6747 commit 0942004
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ui/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,20 @@ function avg_time_e(avgs, v)
avgs[ent_name]["sum"] / avgs[ent_name]["cnt"];
}

function wrap_link(objA, objB, text)
{
let url = null;

if ("link" in objA)
url = objA.link;
else if ("link" in objB)
url = objB.link;
else
return text;

return "<a href=\"" + url + "\">" + text + "</a>";
}

function load_fails(data_raw)
{
var fail_table = document.getElementById("recent-fails");
Expand All @@ -390,7 +404,7 @@ function load_fails(data_raw)
if ("crashes" in r) {
for (crash of r.crashes) {
let i = 0, row = crash_table.insertRow();
row.insertCell(i++).innerHTML = r.test;
row.insertCell(i++).innerHTML = wrap_link(r, v, r.test);
row.insertCell(i++).innerHTML = crash;
}
}
Expand Down

0 comments on commit 0942004

Please sign in to comment.