Only underline clickable legend items in pie charts

Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
yubiuser
2025-06-25 20:17:52 +02:00
parent 353ba2f163
commit a89fdda77e
2 changed files with 4 additions and 3 deletions

View File

@@ -91,17 +91,18 @@ globalThis.htmlLegendPlugin = {
if (isQueryTypeChart || isForwardDestinationChart) { if (isQueryTypeChart || isForwardDestinationChart) {
// Text (link to query log page) // Text (link to query log page)
link.title = `List ${item.text} queries`; link.title = `List ${item.text} queries`;
link.className = "legend-label-text clickable";
if (isQueryTypeChart) { if (isQueryTypeChart) {
link.href = `queries?type=${item.text}`; link.href = `queries?type=${item.text}`;
} else if (isForwardDestinationChart) { } else if (isForwardDestinationChart) {
// Encode the forward destination as it may contain an "#" character // Encode the forward destination as it may contain an "#" character
link.href = `queries?upstream=${encodeURIComponent(upstreams[item.text])}`; link.href = `queries?upstream=${encodeURIComponent(upstreams[item.text])}`;
} }
} else {
link.className = "legend-label-text";
} }
link.style.textDecoration = item.hidden ? "line-through" : ""; link.style.textDecoration = item.hidden ? "line-through" : "";
link.className = "legend-label-text";
link.textContent = item.text; link.textContent = item.text;
li.append(boxSpan, link); li.append(boxSpan, link);

View File

@@ -300,7 +300,7 @@ td.lookatme {
word-break: break-word; word-break: break-word;
} }
.chart-legend li a.legend-label-text:hover { .chart-legend li a.legend-label-text.clickable:hover {
text-decoration: underline; text-decoration: underline;
} }