mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Show time since last update of gravity.list when hovering the "Domains on Blocklist" on the dashboard
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -48,10 +48,27 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$gravitylist = "/etc/pihole/gravity.list";
|
||||
if (file_exists($gravitylist))
|
||||
{
|
||||
$gravitydiff = date_diff(date_create("@".filemtime($gravitylist)),date_create("now"));
|
||||
if($gravitydiff->d > 1)
|
||||
$gravitydate = $gravitydiff->format("Blocking list updated %a days, %H:%I ago");
|
||||
elseif($gravitydiff->d == 1)
|
||||
$gravitydate = $gravitydiff->format("Blocking list updated one day, %H:%I ago");
|
||||
else
|
||||
$gravitydate = $gravitydiff->format("Blocking list updated %H:%I ago");
|
||||
}
|
||||
else
|
||||
{
|
||||
$gravitydate = "Blocking list not found";
|
||||
}
|
||||
?>
|
||||
<!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="small-box bg-red" title="<?php echo $gravitydate; ?>">
|
||||
<div class="inner">
|
||||
<p>Domains on Blocklist</p>
|
||||
<h3 class="statistic"><span id="domains_being_blocked">---</span></h3>
|
||||
|
||||
Reference in New Issue
Block a user