mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
Optimizations to regex link generating code.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -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 <br class='hidden-lg'>(regex blacklist)";
|
||||
|
||||
if (data.length > 9 && data[9] > 0) {
|
||||
fieldtext =
|
||||
"<a href='groups-domains.php?domainid=" +
|
||||
data[9] +
|
||||
"' class=" +
|
||||
colorClass +
|
||||
">" +
|
||||
fieldtext +
|
||||
' <i class="fas fa-link" title="Click to show the regex match"></i></a>';
|
||||
regexLink = true;
|
||||
}
|
||||
|
||||
buttontext =
|
||||
@@ -252,14 +246,7 @@ $(document).ready(function() {
|
||||
fieldtext = "Blocked <br class='hidden-lg'>(regex blacklist, CNAME)";
|
||||
|
||||
if (data.length > 9 && data[9] > 0) {
|
||||
fieldtext =
|
||||
"<a href='groups-domains.php?domainid=" +
|
||||
data[9] +
|
||||
"' class=" +
|
||||
colorClass +
|
||||
">" +
|
||||
fieldtext +
|
||||
' <i class="fas fa-link" title="Click to show the regex match"></i></a>';
|
||||
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];
|
||||
|
||||
Reference in New Issue
Block a user