Skip to content

Commit

Permalink
Merge pull request #1610 from pi-hole/fix/query_retries
Browse files Browse the repository at this point in the history
Add new query status 12 and 13 (retried queries)
  • Loading branch information
PromoFaux authored Nov 8, 2020
2 parents dc5df4e + 6fcd137 commit 33b660d
Show file tree
Hide file tree
Showing 3 changed files with 27 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 @@ -45,6 +45,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_retried" checked><label for="type_retried">Permitted: Retried</label></div>
</div>
<div class="col-md-3">
<div><input type="checkbox" id="type_gravity" checked><label for="type_gravity">Blocked: gravity</label><br></div>
Expand Down
16 changes: 16 additions & 0 deletions scripts/pi-hole/js/db_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ function getQueryTypes() {
queryType.push(11);
}

if ($("#type_retried").prop("checked")) {
// Multiple IDs correspond to this status
// We request queries with all of them
queryType.push([12, 13]);
}

return queryType.join(",");
}

Expand Down Expand Up @@ -317,6 +323,16 @@ $(function () {
buttontext =
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
break;
case 12:
color = "green";
fieldtext = "Retried";
buttontext = "";
break;
case 13:
color = "green";
fieldtext = "Retried <br class='hidden-lg'>(ignored)";
buttontext = "";
break;
default:
color = "black";
fieldtext = "Unknown";
Expand Down
10 changes: 10 additions & 0 deletions scripts/pi-hole/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ $(function () {
'<button type="button" class="btn btn-default btn-sm text-green"><i class="fas fa-check"></i> Whitelist</button>';
isCNAME = true;
break;
case 12:
colorClass = "text-green";
fieldtext = "Retried";
buttontext = "";
break;
case 13:
colorClass = "text-green";
fieldtext = "Retried <br class='hidden-lg'>(ignored)";
buttontext = "";
break;
default:
colorClass = false;
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
Expand Down

0 comments on commit 33b660d

Please sign in to comment.