mirror of
https://github.com/pi-hole/web.git
synced 2025-12-25 05:05:33 +00:00
Merge pull request #304 from pi-hole/new/clickonmaingraph
Clicking on main graph redirects to the Query Log page
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user