mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Merge branch 'devel' into new/clientsovertime
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>
|
||||
|
||||
@@ -358,17 +358,27 @@ function updateForwardDestinationsPie() {
|
||||
var colors = [];
|
||||
// Get colors from AdminLTE
|
||||
$.each($.AdminLTE.options.colors, function(key, value) { colors.push(value); });
|
||||
var v = [], c = [], k = [];
|
||||
// Collect values and colors, immediately push individual labels
|
||||
var v = [], c = [], k = [], values = [];
|
||||
|
||||
// Collect values and colors
|
||||
$.each(data.forward_destinations, function(key , value) {
|
||||
v.push(value);
|
||||
c.push(colors.shift());
|
||||
if(key.indexOf("|") > -1)
|
||||
{
|
||||
key = key.substr(0, key.indexOf("|"));
|
||||
}
|
||||
k.push(key);
|
||||
values.push([key, value, colors.shift()]);
|
||||
});
|
||||
|
||||
// Sort data ASC accorwing to 2nd column, keep already assigned labels and colors
|
||||
values = values.sort(function(a,b) { return b[1] - a[1]; });
|
||||
|
||||
// Split data into individual arrays for the graphs
|
||||
$.each(values, function(key , value) {
|
||||
k.push(value[0]);
|
||||
v.push(value[1]);
|
||||
c.push(value[2]);
|
||||
});
|
||||
|
||||
// Build a single dataset with the data to be pushed
|
||||
var dd = {data: v, backgroundColor: c};
|
||||
// and push it at once
|
||||
@@ -964,7 +974,7 @@ $(document).ready(function() {
|
||||
}
|
||||
},
|
||||
animation: {
|
||||
duration: 2000
|
||||
duration: 750
|
||||
},
|
||||
cutoutPercentage: 0
|
||||
}
|
||||
@@ -1002,7 +1012,7 @@ $(document).ready(function() {
|
||||
}
|
||||
},
|
||||
animation: {
|
||||
duration: 2000
|
||||
duration: 750
|
||||
},
|
||||
cutoutPercentage: 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user