From 09420046766214a258c131a684b75b82ec74b429 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Mon, 20 May 2024 21:45:35 -0700 Subject: [PATCH] ui: status: link to test from crashes Add a URL to the test that crashed for ease of navigation. Signed-off-by: Jakub Kicinski --- ui/status.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ui/status.js b/ui/status.js index 79b4b96..e589e88 100644 --- a/ui/status.js +++ b/ui/status.js @@ -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 "" + text + ""; +} + function load_fails(data_raw) { var fail_table = document.getElementById("recent-fails"); @@ -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; } }