diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index f8c22119..0952674a 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -346,6 +346,14 @@ $(document).ready(function() { $(row).css("color", color); $("td:eq(4)", row).html(fieldtext); $("td:eq(5)", row).html(buttontext); + + // Substitute domain by "." if empty + var domain = data[2]; + if (domain.length === 0) { + domain = "."; + } + + $("td:eq(2)", row).text(domain); }, dom: "<'row'<'col-sm-12'f>>" + diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 7ea1a6d7..dffcd85e 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -293,11 +293,18 @@ $(document).ready(function() { $("td:eq(4)", row).addClass("pointer"); } - // Add domain in CNAME chain causing the query to have been blocked + // Substitute domain by "." if empty var domain = data[2]; - var CNAME_domain = data[8]; + if (domain.length === 0) { + domain = "."; + } + if (isCNAME) { + var CNAME_domain = data[8]; + // Add domain in CNAME chain causing the query to have been blocked $("td:eq(2)", row).text(domain + "\n(blocked " + CNAME_domain + ")"); + } else { + $("td:eq(2)", row).text(domain); } // Check for existence of sixth column and display only if not Pi-holed