mirror of
https://github.com/pi-hole/web.git
synced 2026-02-15 07:25:39 +00:00
Show most recent 100 queries instead of queries within most recent 10 minutes
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -230,6 +230,10 @@ if (isset($_GET['getAllQueries']) && $auth)
|
||||
// Get specific client only
|
||||
sendRequestFTL("getallqueries-client ".$_GET['client']);
|
||||
}
|
||||
else if(is_numeric($_GET['getAllQueries']))
|
||||
{
|
||||
sendRequestFTL("getallqueries (".$_GET['getAllQueries'].")");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get all queries
|
||||
|
||||
@@ -59,7 +59,7 @@ else if(isset($_GET["from"]) && isset($_GET["until"]))
|
||||
}
|
||||
else
|
||||
{
|
||||
$showing .= " within recent 10 minutes, <a href=\"?all\">show all</a>";
|
||||
$showing .= ", most recent 100, <a href=\"?all\">show all</a>";
|
||||
}
|
||||
|
||||
if(isset($setupVars["API_PRIVACY_MODE"]))
|
||||
|
||||
@@ -122,26 +122,27 @@ $(document).ready(function() {
|
||||
location.search.substr(1).split("&").forEach(function(item) {GETDict[item.split("=")[0]] = item.split("=")[1];});
|
||||
|
||||
var APIstring = "api.php?getAllQueries";
|
||||
var options = "";
|
||||
|
||||
if("from" in GETDict && "until" in GETDict)
|
||||
{
|
||||
APIstring += "&from="+GETDict["from"];
|
||||
options += "&from="+GETDict["from"];
|
||||
APIstring += "&until="+GETDict["until"];
|
||||
}
|
||||
else if("client" in GETDict)
|
||||
{
|
||||
APIstring += "&client="+GETDict["client"];
|
||||
options += "&client="+GETDict["client"];
|
||||
}
|
||||
else if("domain" in GETDict)
|
||||
{
|
||||
APIstring += "&domain="+GETDict["domain"];
|
||||
options += "&domain="+GETDict["domain"];
|
||||
}
|
||||
// If we don't ask filtering and also not for all queries, just request the most recent 100 queries
|
||||
else if(!("all" in GETDict))
|
||||
{
|
||||
var timestamp = Math.floor(Date.now() / 1000);
|
||||
APIstring += "&from="+(timestamp - 600);
|
||||
APIstring += "&until="+(timestamp + 100);
|
||||
APIstring += "=100";
|
||||
}
|
||||
APIstring += options;
|
||||
|
||||
tableApi = $("#all-queries").DataTable( {
|
||||
"rowCallback": function( row, data, index ){
|
||||
|
||||
Reference in New Issue
Block a user