diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js
index db157011..118ba9ac 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":
@@ -199,15 +200,8 @@ $(document).ready(function() {
colorClass = "text-red";
fieldtext = "Blocked
(regex blacklist)";
- if (data.length > 9 && data[9] > -1) {
- fieldtext =
- "" +
- fieldtext +
- ' ';
+ if (data.length > 9 && data[9] > 0) {
+ regexLink = true;
}
buttontext =
@@ -250,6 +244,11 @@ $(document).ready(function() {
blocked = true;
colorClass = "text-red";
fieldtext = "Blocked
(regex blacklist, CNAME)";
+
+ if (data.length > 9 && data[9] > 0) {
+ regexLink = true;
+ }
+
buttontext =
'';
isCNAME = true;
@@ -273,6 +272,26 @@ $(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).addClass("underline");
+ $("td:eq(4)", row).addClass("pointer");
+ }
+
// Add domain in CNAME chain causing the query to have been blocked
var domain = data[2];
var CNAME_domain = data[8];
diff --git a/style/pi-hole.css b/style/pi-hole.css
index eb986c22..b17a4a17 100644
--- a/style/pi-hole.css
+++ b/style/pi-hole.css
@@ -242,4 +242,12 @@
td.highlight {
background-color: yellow;
-}
\ No newline at end of file
+}
+
+.underline {
+ text-decoration: underline;
+}
+
+.pointer {
+ cursor: pointer;
+}