From ca57bcfb5c7c388562c0dd9c77be2de8cbe5ebc4 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 16 Sep 2025 16:47:03 -0300 Subject: [PATCH] Include the upstream DNS server name to the link, when needed The link must send the "upstream" parameter in exactly the same format used by the "suggestions" API. The format is: "upstream=# ()". This will ensure that when a link is clicked, the correct server name will be highlighted in the SELECT element on the queries.lp page and no other OPTION element will be created. Signed-off-by: RD WebDesign --- scripts/js/charts.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/js/charts.js b/scripts/js/charts.js index 967b4bc2..8dc24023 100644 --- a/scripts/js/charts.js +++ b/scripts/js/charts.js @@ -100,10 +100,14 @@ globalThis.htmlLegendPlugin = { // Encode the forward destination as it may contain an "#" character link.href = `queries?upstream=${encodeURIComponent(upstreamIPs[item.index])}`; - // If server name and IP are different, replace the title tooltip - // including the upstream IP to the text + // If server name and IP are different: if (item.text !== upstreamIPs[item.index]) { + // replace the title tooltip to include the upstream IP to the text ... link.title = `List ${item.text} (${upstreamIPs[item.index]}) queries`; + + // ... and include the server name (without port) to the querystring, to match + // the text used on the SELECT element (sent by suggestions API endpoint) + link.href += ` (${item.text.split("#")[0]})`; } } } else {