Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query type "Blocked (special domain)" #2185

Merged
merged 2 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions db_queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<div class="col-md-3">
<div><input type="checkbox" id="type_blacklist" checked><label for="type_blacklist">Blocked: exact blacklist</label><br></div>
<div><input type="checkbox" id="type_regex" checked><label for="type_regex">Blocked: regex blacklist</label></div>
<div><input type="checkbox" id="type_special_domain" checked><label for="type_special_domain">Blocked: special domain</label></div>
</div>
<div class="col-md-3">
<div><input type="checkbox" id="type_gravity_CNAME" checked><label for="type_gravity_CNAME">Blocked: gravity (CNAME)</label><br></div>
Expand Down
13 changes: 11 additions & 2 deletions scripts/pi-hole/js/db_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ function getQueryTypes() {
queryType.push(15);
}

if ($("#type_special_domain").prop("checked")) {
queryType.push(16);
}

return queryType.join(",");
}

Expand Down Expand Up @@ -184,7 +188,7 @@ function refreshTableData() {
var APIstring = "api_db.php?getAllQueries&from=" + from + "&until=" + until;
// Check if query type filtering is enabled
var queryType = getQueryTypes();
if (queryType !== "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15") {
if (queryType !== "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16") {
APIstring += "&types=" + queryType;
}

Expand Down Expand Up @@ -292,8 +296,13 @@ $(function () {
"<span class='text-orange'>Blocked <br class='hidden-lg'>(database is busy)</span>";
blocked = true;
break;
case 16:
fieldtext =
"<span class='text-orange'>Blocked <br class='hidden-lg'>(special domain)</span>";
blocked = true;
break;
default:
fieldtext = "Unknown";
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
}

$(row).addClass(blocked === true ? "blocked-row" : "allowed-row");
Expand Down
5 changes: 5 additions & 0 deletions scripts/pi-hole/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ $(function () {
"<span class='text-orange'>Blocked <br class='hidden-lg'>(database is busy)</span>";
blocked = true;
break;
case "16":
fieldtext =
"<span class='text-orange'>Blocked <br class='hidden-lg'>(special domain)</span>";
blocked = true;
break;
default:
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
}
Expand Down