@@ -200,11 +200,11 @@
["assigned_to", "Owner"],
]);
- function populateTable(selector, bugs) {
+ function populateTable(selector, bugs, bzlink) {
if (bugs.length === 0) {
const p = document.createElement("p");
p.innerHTML = "<em>No bugs found</em>.";
- document.querySelector(selector).replaceChildren(p);
+ document.querySelector(selector).replaceChildren(p, bzlink);
return;
}
@@ -230,7 +230,7 @@
}
const footer = table.appendChild(document.createElement("tfoot"));
- footer.innerHTML = `<tr><td colspan="${fields.size}">${bugs.length} bugs found.</td></tr>`;
+ footer.innerHTML = `<tr><td colspan="${fields.size}">${bugs.length} bugs found. ${bzlink.outerHTML}</td></tr>`;
sorttable.makeSortable(table);
@@ -245,7 +245,11 @@
const spinner = document.createElement("div");
spinner.setAttribute("class", "progress")
spinner.innerHTML = `<div class="indeterminate"></div>`;
- document.querySelector(selector).replaceChildren(spinner);
+ var bzlink = document.createElement("a");
+ var buglistURL = `${serverUrl}/buglist.cgi?${params}`;
+ bzlink.setAttribute("href", buglistURL);
+ bzlink.appendChild(document.createTextNode("View on Bugzilla"));
+ document.querySelector(selector).replaceChildren(spinner, bzlink);
try {
@@ -255,7 +259,7 @@
}
const data = await response.json();
- populateTable(selector, data.bugs);
+ populateTable(selector, data.bugs, bzlink);
} catch (error) {
console.error(`Failed to fetch bugs for ${selector}: ${error}`);
alert("Error fetching bugs. Check the console for details.");