Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions scripts/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ var filters = [
"reply",
"dnssec",
];
var doDNSSEC = false;

// Check if pihole is validiting DNSSEC
function getDnssecConfig() {
$.getJSON(
document.body.dataset.apiurl + "/config/dns/dnssec",
function(data) {
doDNSSEC = data.config.dns.dnssec;
}
);
}

function initDateRangePicker() {
$("#querytime").daterangepicker(
Expand Down Expand Up @@ -498,6 +509,9 @@ function liveUpdate() {
}

$(function () {
// Do we want to show DNSSEC icons?
getDnssecConfig();

// Do we want to filter queries?
var GETDict = utils.parseQueryString();

Expand All @@ -506,7 +520,7 @@ $(function () {
var element = filters[sel];
$("#" + element + "_filter").select2({
width: "100%",
tags: sel < 3, // Only the first three are allowed to freely specify input
tags: sel < 4, // Only the first four (client(IP/name), domain, upstream) are allowed to freely specify input
placeholder: "Select...",
allowClear: true,
});
Expand Down Expand Up @@ -588,7 +602,6 @@ $(function () {
},
rowCallback: function (row, data) {
var querystatus = parseQueryStatus(data);
const dnssec = parseDNSSEC(data);

if (querystatus.icon !== false) {
$("td:eq(1)", row).html(
Expand All @@ -612,14 +625,17 @@ $(function () {

// Prefix colored DNSSEC icon to domain text
var dnssecIcon = "";
dnssecIcon =
'<i class="mr-2 fa fa-fw ' +
dnssec.icon +
" " +
dnssec.color +
'" title="DNSSEC: ' +
dnssec.text +
'"></i>';
if (doDNSSEC === true) {
const dnssec = parseDNSSEC(data);
dnssecIcon =
'<i class="mr-2 fa fa-fw ' +
dnssec.icon +
" " +
dnssec.color +
'" title="DNSSEC: ' +
dnssec.text +
'"></i>';
}

// Escape HTML in domain
domain = dnssecIcon + utils.escapeHtml(domain);
Expand Down
10 changes: 10 additions & 0 deletions style/pi-hole.css
Original file line number Diff line number Diff line change
Expand Up @@ -1583,3 +1583,13 @@ textarea.field-sizing-content {
line-height: 0.5em;
font-size: 1.7em;
}

/* Used in query log page */
td.dnssec {
padding-inline-start: 2.25em !important;
text-indent: -1.25em;
}
td.dnssec i {
text-indent: 0;
margin-left: -0.5rem;
}
Loading