Merge pull request #304 from pi-hole/new/clickonmaingraph

Clicking on main graph redirects to the Query Log page
This commit is contained in:
Adam Warner
2017-01-01 20:10:34 +00:00
committed by GitHub
3 changed files with 67 additions and 5 deletions

View File

@@ -284,6 +284,15 @@
// Create empty array for gravity
$gravity_domains = getGravity();
if(isset($_GET["from"]))
{
$from = new DateTime($_GET["from"]);
}
if(isset($_GET["until"]))
{
$until = new DateTime($_GET["until"]);
}
setShowBlockedPermitted();
// Privacy mode?
@@ -299,7 +308,26 @@
}
foreach ($dns_queries as $query) {
$time = date_create(substr($query, 0, 16));
$time = new DateTime(substr($query, 0, 16));
// Check if we want to restrict the time where we want to show queries
if(isset($from))
{
if($time <= $from)
{
continue;
}
}
if(isset($until))
{
if($time >= $until)
{
continue;
}
}
// print_r([$time->getTimestamp(),$_GET["from"],$_GET["until"]]);
$exploded = explode(" ", trim($query));
$domain = $exploded[count($exploded)-3];
$tmp = $exploded[count($exploded)-4];