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:
DL6ER
2018-02-10 14:10:55 +01:00
parent 2fd7f5a85c
commit 1db322b963
3 changed files with 12 additions and 7 deletions

View File

@@ -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

View File

@@ -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"]))

View File

@@ -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 ){