From 4d8f4a129cf5a889e178effa9e76c5c23c56226b Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 5 Jul 2023 17:26:46 -0300 Subject: [PATCH 1/2] Move `datatables` and `daterangepicker` CSS files to header.lp and add a condition to load them only if authenticated. Signed-off-by: RD WebDesign --- scripts/pi-hole/lua/header.lp | 12 ++++++++++-- scripts/pi-hole/lua/header_authenticated.lp | 3 --- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/pi-hole/lua/header.lp b/scripts/pi-hole/lua/header.lp index d444e498..9790cc29 100644 --- a/scripts/pi-hole/lua/header.lp +++ b/scripts/pi-hole/lua/header.lp @@ -43,6 +43,9 @@ end -- a reverse proxy (e.g. Traefik) is_secure = mg.request_info.https or pihole.rev_proxy() +-- Variable to check if user is already authenticated +is_authenticated = mg.request_info.is_authenticated + ?> @@ -86,15 +89,20 @@ is_secure = mg.request_info.https or pihole.rev_proxy() + + + + + - + - + diff --git a/scripts/pi-hole/lua/header_authenticated.lp b/scripts/pi-hole/lua/header_authenticated.lp index d062fd7a..acecf73c 100644 --- a/scripts/pi-hole/lua/header_authenticated.lp +++ b/scripts/pi-hole/lua/header_authenticated.lp @@ -9,9 +9,6 @@ ]]-- mg.include('header.lp','r') ?> - - - From bb861e41d0567b222fe84a24446cccac8bfe47fa Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 5 Jul 2023 17:54:06 -0300 Subject: [PATCH 2/2] Reorder CSS files to fix some style dependencies Signed-off-by: RD WebDesign --- scripts/pi-hole/lua/header.lp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/pi-hole/lua/header.lp b/scripts/pi-hole/lua/header.lp index 9790cc29..1facf8ea 100644 --- a/scripts/pi-hole/lua/header.lp +++ b/scripts/pi-hole/lua/header.lp @@ -89,20 +89,21 @@ is_authenticated = mg.request_info.is_authenticated + + + + + - - - - - - - - +