Merge pull request #1627 from pi-hole/new/query_log_upstream_details

Show detailed upstream destination in Query Log(s)
This commit is contained in:
DL6ER
2020-11-15 08:37:27 +01:00
committed by GitHub
3 changed files with 12 additions and 5 deletions
+3 -3
View File
@@ -94,7 +94,7 @@ if (isset($_GET['getAllQueries']) && $auth)
{
$from = intval($_GET["from"]);
$until = intval($_GET["until"]);
$dbquery = "SELECT timestamp, type, domain, client, status FROM queries WHERE timestamp >= :from AND timestamp <= :until ";
$dbquery = "SELECT timestamp, type, domain, client, status, forward FROM queries WHERE timestamp >= :from AND timestamp <= :until ";
if(isset($_GET["types"]))
{
$types = $_GET["types"];
@@ -153,8 +153,8 @@ if (isset($_GET['getAllQueries']) && $auth)
$query_type = "UNKN";
break;
}
// array: time type domain client status
$allQueries[] = [$row[0], $query_type, utf8_encode($row[2]), utf8_encode($c), $row[4]];
// array: time type domain client status upstream destination
$allQueries[] = [$row[0], $query_type, utf8_encode($row[2]), utf8_encode($c), $row[4], utf8_encode($row[5])];
}
}
$result = array('data' => $allQueries);
+4 -1
View File
@@ -268,7 +268,10 @@ $(function () {
break;
case 2:
color = "green";
fieldtext = "OK <br class='hidden-lg'>(forwarded)";
fieldtext =
"OK <br class='hidden-lg'>(forwarded to " +
(data.length > 5 && data[5] !== "N/A" ? data[5] : "") +
")";
buttontext =
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;
+5 -1
View File
@@ -188,7 +188,11 @@ $(function () {
break;
case "2":
colorClass = "text-green";
fieldtext = "OK <br class='hidden-lg'>(forwarded)" + dnssecStatus;
fieldtext =
"OK <br class='hidden-lg'>(forwarded to " +
(data.length > 10 && data[10] !== "N/A" ? data[10] : "") +
")" +
dnssecStatus;
buttontext =
'<button type="button" class="btn btn-default btn-sm text-red"><i class="fa fa-ban"></i> Blacklist</button>';
break;