From 3e94ff0f438fa6d495e625f5c7276e0b1f1500b0 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Tue, 12 May 2020 12:58:45 +0100 Subject: [PATCH 1/7] Update adminLTE to 2.4. - Change a few references per upgrade guide - define colors[] at the top of index.js as AdminLTE.options does not appear to exist. (there may be a better way of doing this) Signed-off-by: Adam Warner --- scripts/pi-hole/js/index.js | 33 +++++++++++++++++---------------- scripts/pi-hole/php/header.php | 6 +++--- scripts/vendor/adminlte.min.js | 13 +++++++++++++ scripts/vendor/app.min.js | 13 ------------- 4 files changed, 33 insertions(+), 32 deletions(-) create mode 100644 scripts/vendor/adminlte.min.js delete mode 100644 scripts/vendor/app.min.js diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 13e27fb4..6401f113 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -10,6 +10,23 @@ var timeLineChart, clientsChart; var queryTypePieChart, forwardDestinationPieChart; +var colors = [ "#3c8dbc", + "#f56954", + "#00a65a", + "#00c0ef", + "#f39c12", + "#0073b7", + "#001F3F", + "#39CCCC", + "#3D9970", + "#01FF70", + "#FF851B", + "#F012BE", + "#8E24AA", + "#D81B60", + "#222222", + "#d2d6de"]; + function padNumber(num) { return ("00" + num).substr(-2, 2); } @@ -279,11 +296,6 @@ function updateQueryTypesPie() { return; } - var colors = []; - // Get colors from AdminLTE - $.each($.AdminLTE.options.colors, function (key, value) { - colors.push(value); - }); var v = [], c = [], k = [], @@ -375,12 +387,6 @@ function updateClientsOverTime() { labels.push(clientname); } - // Get colors from AdminLTE - var colors = []; - $.each($.AdminLTE.options.colors, function (key, value) { - colors.push(value); - }); - // Remove possibly already existing data clientsChart.data.labels = []; clientsChart.data.datasets[0].data = []; @@ -453,11 +459,6 @@ function updateForwardDestinationsPie() { return; } - var colors = []; - // Get colors from AdminLTE - $.each($.AdminLTE.options.colors, function (key, value) { - colors.push(value); - }); var v = [], c = [], k = [], diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index fcf94274..14d1af9c 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -211,7 +211,7 @@ - + @@ -258,7 +258,7 @@ if($auth) {