From 84db04e51e0a8dd6e5d01eef95cb76b573335cff Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 23 Sep 2017 12:44:07 +0200 Subject: [PATCH 1/3] Show time since last update of gravity.list when hovering the "Domains on Blocklist" on the dashboard Signed-off-by: DL6ER --- index.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index b97cd0bb..ee596e57 100644 --- a/index.php +++ b/index.php @@ -48,10 +48,27 @@ +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"; +} +?>
-
+

Domains on Blocklist

---

From 0ed1901a8e33e68df1889833b09bca086383bd57 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 27 Sep 2017 17:03:00 +0200 Subject: [PATCH 2/3] Apply proper sorting whilst preserve the color order for the doughnut forward destinations chart Signed-off-by: DL6ER --- scripts/pi-hole/js/index.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index e2b0660d..2d576029 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -272,17 +272,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 From 2789b6946062c9d816698e61a5f480006956604f Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Fri, 29 Sep 2017 23:12:20 +1000 Subject: [PATCH 3/3] Decrease doughnut animation time on first load --- scripts/pi-hole/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 2d576029..48a2d6f0 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -830,7 +830,7 @@ $(document).ready(function() { } }, animation: { - duration: 2000 + duration: 750 }, cutoutPercentage: 0 } @@ -868,7 +868,7 @@ $(document).ready(function() { } }, animation: { - duration: 2000 + duration: 750 }, cutoutPercentage: 0 }