From 23ecbd1b20aec56bd4383254da05113e5850ce3d Mon Sep 17 00:00:00 2001 From: db-2001 Date: Mon, 10 Jun 2024 22:19:46 -0400 Subject: [PATCH] Addresses https://github.com/C9Glax/tranga-website/issues/87 --- Website/apiConnector.js | 8 ++++---- Website/index.html | 7 ++++--- Website/interaction.js | 18 +++++++++++------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Website/apiConnector.js b/Website/apiConnector.js index 67e94bd..9cfdc3d 100644 --- a/Website/apiConnector.js +++ b/Website/apiConnector.js @@ -338,8 +338,8 @@ function TestLunaSea(lunaseaWebhook){ } //Ntfy -function UpdateNtfy(ntfyEndpoint, ntfyAuth){ - var uri = `${apiUri}/NotificationConnectors/Update?notificationConnector=Ntfy&ntfyUrl=${ntfyEndpoint}&ntfyAuth=${ntfyAuth}`; +function UpdateNtfy(ntfyEndpoint, ntfyUser, ntfyPass){ + var uri = `${apiUri}/NotificationConnectors/Update?notificationConnector=Ntfy&ntfyUrl=${ntfyEndpoint}&ntfyUser=${ntfyUser}&ntfyPass=${ntfyPass}`; PostData(uri); } @@ -348,8 +348,8 @@ function ResetNtfy(){ PostData(uri); } -function TestNtfy(ntfyEndpoint, ntfyAuth){ - var uri = `${apiUri}/NotificationConnectors/Test?notificationConnector=Ntfy&ntfyUrl=${ntfyEndpoint}&ntfyAuth=${ntfyAuth}`; +function TestNtfy(ntfyEndpoint, ntfyUser, ntfyPass){ + var uri = `${apiUri}/NotificationConnectors/Test?notificationConnector=Ntfy&ntfyUrl=${ntfyEndpoint}&ntfyUser=${ntfyUser}&ntfyPass=${ntfyPass}}`; PostData(uri); } diff --git a/Website/index.html b/Website/index.html index 93250b2..80a2709 100644 --- a/Website/index.html +++ b/Website/index.html @@ -235,11 +235,12 @@
Ntfy - + +
- Test + Test Reset - Apply + Apply
diff --git a/Website/interaction.js b/Website/interaction.js index 5434535..6ad91ed 100644 --- a/Website/interaction.js +++ b/Website/interaction.js @@ -60,7 +60,8 @@ const settingLunaseaWebhook = document.querySelector("#lunaseaWebhook"); //Ntfy const settingNtfyEndpoint = document.querySelector("#ntfyEndpoint"); -const settingNtfyAuth = document.querySelector("#ntfyAuth"); +const settingNtfyUser = document.querySelector("#ntfyUser"); +const settingNtfyPass = document.querySelector("#ntfyPass"); //Connector Configured const settingKomgaConfigured = document.querySelector("#komgaConfigured"); @@ -758,7 +759,7 @@ settingGotifyUrl.addEventListener("keypress", (event) => { if(event.key === "Ent settingGotifyAppToken.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); settingLunaseaWebhook.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); settingNtfyEndpoint.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); -settingNtfyAuth.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); +settingNtfyPass.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); settingUserAgent.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); settingApiUri.addEventListener("keypress", (event) => { if(event.key === "Enter") UpdateSettings(); }); @@ -785,7 +786,8 @@ function OpenSettings(){ settingGotifyUrl.value = ""; settingGotifyAppToken.value = ""; settingLunaseaWebhook.value = ""; - settingNtfyAuth.value = ""; + settingNtfyUser.value = ""; + settingNtfyPass.value = ""; settingNtfyEndpoint.value = ""; settingUserAgent.value = ""; settingApiUri.value = ""; @@ -850,7 +852,8 @@ function OpenSettings(){ case "Ntfy": settingNtfyConfigured.setAttribute("configuration", "Active"); settingNtfyEndpoint.placeholder = connector.endpoint; - settingNtfyAuth.placeholder = "***"; + settingNtfyUser.placeholder = "***" + settingNtfyPass.placeholder = "***"; break; default: console.log("Unknown type"); @@ -893,7 +896,8 @@ function ClearLunasea(){ function ClearNtfy(){ settingNtfyEndpoint.value = ""; - settingNtfyAuth.value = ""; + settingNtfyUser.value = ""; + settingNtfyPass.value = ""; settingNtfyConfigured.setAttribute("configuration", "Not Configured"); ResetNtfy(); } @@ -927,8 +931,8 @@ function UpdateSettings(){ } if(settingNtfyEndpoint.value != "" && - settingNtfyAuth.value != ""){ - UpdateNtfy(settingNtfyEndpoint.value, settingNtfyAuth.value); + settingNtfyUser.value != ""){ + UpdateNtfy(settingNtfyEndpoint.value, settingNtfyUser.value, settingNtfyPass.value); } if(settingUserAgent.value != ""){