From 3681d7187a44b32a667f40b585629d45bf4e44e9 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 15 Jun 2024 11:24:00 +0200 Subject: [PATCH 1/8] Show warning if user already set an application password Signed-off-by: DL6ER --- scripts/pi-hole/js/settings-api.js | 2 ++ settings-api.lp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/scripts/pi-hole/js/settings-api.js b/scripts/pi-hole/js/settings-api.js index d64a61925..ffb6cc459 100644 --- a/scripts/pi-hole/js/settings-api.js +++ b/scripts/pi-hole/js/settings-api.js @@ -266,6 +266,8 @@ function processWebServerConfig() { }) .done(function (data) { setConfigValues("webserver", "webserver", data.config.webserver); + if (data.config.webserver.api.app_pwhash.value.length > 0) + $("#existing_apppw_warning").show(); }) .fail(function (data) { apiFailure(data); diff --git a/settings-api.lp b/settings-api.lp index de587cd61..97efa5710 100644 --- a/settings-api.lp +++ b/settings-api.lp @@ -260,6 +260,9 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')

IMPORTANT: The app password generated here will only be shown once and cannot be recovered. Make sure to store it in a safe place!

+ From e9aea93298f40d76cc51a5a77a5596199f77a1d3 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 25 Jun 2024 18:29:57 -0300 Subject: [PATCH 7/8] Fix close button contrast in some dark themes Signed-off-by: RD WebDesign --- style/themes/default-dark.css | 7 ++++++- style/themes/high-contrast-dark.css | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/style/themes/default-dark.css b/style/themes/default-dark.css index 5ad4c2b43..a67a67915 100644 --- a/style/themes/default-dark.css +++ b/style/themes/default-dark.css @@ -630,7 +630,12 @@ input[type="password"]::-webkit-caps-lock-indicator { } .close { - color: #383838; + color: #fff; + text-shadow: 0 1px 0 #000; +} +.close:focus, +.close:hover { + color: #fff; } .login-page { diff --git a/style/themes/high-contrast-dark.css b/style/themes/high-contrast-dark.css index 64ed35167..1705f9ba7 100644 --- a/style/themes/high-contrast-dark.css +++ b/style/themes/high-contrast-dark.css @@ -823,7 +823,14 @@ input[type="password"]::-webkit-caps-lock-indicator { } .close { - color: #383838; + color: #fff; + text-shadow: 0 1px 0 #000; + opacity: 0.4; +} +.close:focus, +.close:hover { + color: #fff; + opacity: 0.8; } .login-page { From d3ac2fed8d42a138f867c32b478a640c3d8ea8a8 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 26 Jun 2024 11:03:28 +0200 Subject: [PATCH 8/8] Remove "Remove currently set app password" button if none is actually set Signed-off-by: DL6ER --- scripts/pi-hole/js/settings-api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/settings-api.js b/scripts/pi-hole/js/settings-api.js index 88b3510e0..07ac488ce 100644 --- a/scripts/pi-hole/js/settings-api.js +++ b/scripts/pi-hole/js/settings-api.js @@ -273,7 +273,7 @@ function processWebServerConfig() { $("#apppw_submit").text("Replace app password"); $("#apppw_submit").removeClass("btn-success"); $("#apppw_submit").addClass("btn-warning"); - } + } else $("#apppw_clear").hide(); }) .fail(function (data) { apiFailure(data);