Skip to content

Commit

Permalink
Add stale cache query status
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Nov 7, 2022
1 parent 231d7e4 commit e5bc86b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions db_queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<div class="col-md-3">
<div><input type="checkbox" id="type_forwarded" checked><label for="type_forwarded">Permitted: forwarded</label><br></div>
<div><input type="checkbox" id="type_cached" checked><label for="type_cached">Permitted: cached</label></div>
<div><input type="checkbox" id="type_cached" checked><label for="type_cached_stale">Permitted: stale cache</label></div>
<div><input type="checkbox" id="type_retried" checked><label for="type_retried">Permitted: retried</label></div>
</div>
<div class="col-md-3">
Expand Down
10 changes: 10 additions & 0 deletions scripts/pi-hole/js/db_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ function excludeStatusTypes() {
statusType.push(16);
}

if ($("#type_cached_stale").prop("checked") === false) {
statusType.push(17);
}

return statusType.join(",");
}

Expand Down Expand Up @@ -349,6 +353,12 @@ $(function () {
"<span class='text-orange'>Blocked <br class='hidden-lg'>(special domain)</span>";
blocked = true;
break;
case 17:
fieldtext =
"<span class='text-orange'>OK</span> <br class='hidden-lg'>(stale cache)" + dnssecStatus;
buttontext =
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;
default:
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
}
Expand Down
6 changes: 6 additions & 0 deletions scripts/pi-hole/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ $(function () {
"<span class='text-orange'>Blocked <br class='hidden-lg'>(special domain)</span>";
blocked = true;
break;
case "17":
fieldtext =
"<span class='text-orange'>OK</span> <br class='hidden-lg'>(stale cache)" + dnssecStatus;
buttontext =
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;
default:
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
}
Expand Down

0 comments on commit e5bc86b

Please sign in to comment.