mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Add new blocked by database status and NONE reply types
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+2
-1
@@ -45,11 +45,12 @@
|
||||
<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><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>
|
||||
<div><input type="checkbox" id="type_external" checked><label for="type_external">Blocked: external</label></div>
|
||||
<div><input type="checkbox" id="type_dbbusy" checked><label for="type_dbbusy">Blocked: database busy</label></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div><input type="checkbox" id="type_blacklist" checked><label for="type_blacklist">Blocked: exact blacklist</label><br></div>
|
||||
|
||||
@@ -137,6 +137,12 @@ function getQueryTypes() {
|
||||
queryType.push([12, 13]);
|
||||
}
|
||||
|
||||
// 14 is defined above
|
||||
|
||||
if ($("#type_dbbusy").prop("checked")) {
|
||||
queryType.push(15);
|
||||
}
|
||||
|
||||
return queryType.join(",");
|
||||
}
|
||||
|
||||
@@ -172,7 +178,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") {
|
||||
if (queryType !== "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15") {
|
||||
APIstring += "&types=" + queryType;
|
||||
}
|
||||
|
||||
@@ -194,7 +200,9 @@ $(function () {
|
||||
|
||||
tableApi = $("#all-queries").DataTable({
|
||||
rowCallback: function (row, data) {
|
||||
var fieldtext, buttontext, color;
|
||||
var fieldtext,
|
||||
buttontext = "",
|
||||
color;
|
||||
switch (data[4]) {
|
||||
case 1:
|
||||
color = "red";
|
||||
@@ -232,17 +240,14 @@ $(function () {
|
||||
case 6:
|
||||
color = "red";
|
||||
fieldtext = "Blocked <br class='hidden-lg'>(external, IP)";
|
||||
buttontext = "";
|
||||
break;
|
||||
case 7:
|
||||
color = "red";
|
||||
fieldtext = "Blocked <br class='hidden-lg'>(external, NULL)";
|
||||
buttontext = "";
|
||||
break;
|
||||
case 8:
|
||||
color = "red";
|
||||
fieldtext = "Blocked <br class='hidden-lg'>(external, NXRA)";
|
||||
buttontext = "";
|
||||
break;
|
||||
case 9:
|
||||
color = "red";
|
||||
@@ -265,7 +270,6 @@ $(function () {
|
||||
case 12:
|
||||
color = "green";
|
||||
fieldtext = "Retried";
|
||||
buttontext = "";
|
||||
break;
|
||||
case 13:
|
||||
color = "green";
|
||||
@@ -278,10 +282,13 @@ $(function () {
|
||||
buttontext =
|
||||
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
|
||||
break;
|
||||
case 15:
|
||||
color = "text-orange";
|
||||
fieldtext = "Blocked <br class='hidden-lg'>(database is busy)";
|
||||
break;
|
||||
default:
|
||||
color = "black";
|
||||
fieldtext = "Unknown";
|
||||
buttontext = "";
|
||||
}
|
||||
|
||||
$(row).css("color", color);
|
||||
|
||||
@@ -23,6 +23,7 @@ var replyTypes = [
|
||||
"NOTIMP",
|
||||
"upstream error",
|
||||
"DNSSEC",
|
||||
"NONE",
|
||||
];
|
||||
var colTypes = ["time", "query type", "domain", "client", "status", "reply type"];
|
||||
|
||||
@@ -78,7 +79,7 @@ $(function () {
|
||||
var replyid = parseInt(data[5], 10);
|
||||
// DNSSEC status
|
||||
var dnssecStatus;
|
||||
var ede = data[11];
|
||||
var ede = data[11] ? data[11] : "";
|
||||
switch (data[6]) {
|
||||
case "1":
|
||||
dnssecStatus = '<br><span class="text-green">SECURE';
|
||||
@@ -108,7 +109,7 @@ $(function () {
|
||||
|
||||
// Query status
|
||||
var fieldtext,
|
||||
buttontext,
|
||||
buttontext = "",
|
||||
colorClass = false,
|
||||
isCNAME = false,
|
||||
regexLink = false;
|
||||
@@ -197,12 +198,10 @@ $(function () {
|
||||
case "12":
|
||||
colorClass = "text-green";
|
||||
fieldtext = "Retried";
|
||||
buttontext = "";
|
||||
break;
|
||||
case "13":
|
||||
colorClass = "text-green";
|
||||
fieldtext = "Retried <br class='hidden-lg'>(ignored)";
|
||||
buttontext = "";
|
||||
break;
|
||||
case "14":
|
||||
colorClass = "text-green";
|
||||
@@ -210,10 +209,13 @@ $(function () {
|
||||
buttontext =
|
||||
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
|
||||
break;
|
||||
case "15":
|
||||
colorClass = "text-orange";
|
||||
fieldtext = "Blocked <br class='hidden-lg'>(database is busy)";
|
||||
break;
|
||||
default:
|
||||
colorClass = false;
|
||||
fieldtext = "Unknown (" + parseInt(data[4], 10) + ")";
|
||||
buttontext = "";
|
||||
}
|
||||
|
||||
// Add EDE here if available and not included in dnssecStatus
|
||||
|
||||
Reference in New Issue
Block a user