diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js
index d68aa29c..95f847da 100644
--- a/scripts/pi-hole/js/queries.js
+++ b/scripts/pi-hole/js/queries.js
@@ -170,7 +170,8 @@ $(document).ready(function() {
fieldtext,
buttontext,
colorClass,
- isCNAME = false;
+ isCNAME = false,
+ regexLink = false;
switch (data[4]) {
case "1":
@@ -200,14 +201,7 @@ $(document).ready(function() {
fieldtext = "Blocked
(regex blacklist)";
if (data.length > 9 && data[9] > 0) {
- fieldtext =
- "" +
- fieldtext +
- ' ';
+ regexLink = true;
}
buttontext =
@@ -252,14 +246,7 @@ $(document).ready(function() {
fieldtext = "Blocked
(regex blacklist, CNAME)";
if (data.length > 9 && data[9] > 0) {
- fieldtext =
- "" +
- fieldtext +
- ' ';
+ regexLink = true;
}
buttontext =
@@ -285,6 +272,25 @@ $(document).ready(function() {
$("td:eq(4)", row).html(fieldtext);
$("td:eq(6)", row).html(buttontext);
+ if (regexLink) {
+ $("td:eq(4)", row).hover(
+ function() {
+ this.title = "Click to show matching regex filter";
+ this.style.color = "#72afd2";
+ },
+ function() {
+ this.style.color = "";
+ }
+ );
+ $("td:eq(4)", row).click(function() {
+ var new_tab = window.open("groups-domains.php?domainid=" + data[9], "_blank");
+ if (new_tab) {
+ new_tab.focus();
+ }
+ });
+ $("td:eq(4)", row).css("cursor", "pointer");
+ }
+
// Add domain in CNAME chain causing the query to have been blocked
var domain = data[2];
var CNAME_domain = data[8];