diff --git a/Website/apiConnector.js b/Website/apiConnector.js
index 38d1175..ebeb640 100644
--- a/Website/apiConnector.js
+++ b/Website/apiConnector.js
@@ -126,17 +126,27 @@ function EnqueueTask(taskType, connectorName, publicationId){
PostData(uri);
}
-function UpdateSettings(downloadLocation, komgaUrl, komgaAuth, kavitaUrl, kavitaUser, kavitaPass){
+function UpdateDownloadLocation(downloadLocation){
var uri = apiUri + "/Settings/Update?"
- if(downloadLocation != ""){
- uri += "&downloadLocation="+downloadLocation;
- }
- if(komgaUrl != "" && komgaAuth != ""){
- uri += `&komgaUrl=${komgaUrl}&komgaAuth=${komgaAuth}`;
- }
- if(kavitaUrl != "" && kavitaUser != "" && kavitaPass != ""){
- uri += `&kavitaUrl=${kavitaUrl}&kavitaUsername=${kavitaUser}&kavitaPassword=${kavitaPass}`;
- }
+ uri += "&downloadLocation="+downloadLocation;
+ PostData(uri);
+}
+
+function UpdateKomga(komgaUrl, komgaAuth){
+ var uri = apiUri + "/Settings/Update?"
+ uri += `&komgaUrl=${komgaUrl}&komgaAuth=${komgaAuth}`;
+ PostData(uri);
+}
+
+function UpdateKavita(kavitaUrl, kavitaUser, kavitaPass){
+ var uri = apiUri + "/Settings/Update?"
+ uri += `&kavitaUrl=${kavitaUrl}&kavitaUsername=${kavitaUser}&kavitaPassword=${kavitaPass}`;
+ PostData(uri);
+}
+
+function UpdateGotify(gotifyUrl, gotifyAppToken){
+ var uri = apiUri + "/Settings/Update?"
+ uri += `&gotifyUrl=${gotifyUrl}&gotifyAppToken=${gotifyAppToken}`;
PostData(uri);
}
diff --git a/Website/index.html b/Website/index.html
index 151befa..5b3db59 100644
--- a/Website/index.html
+++ b/Website/index.html
@@ -133,6 +133,12 @@
+
+
Gotify
+
Configured: ✅❌
+
+
+
diff --git a/Website/interaction.js b/Website/interaction.js
index 6592a78..6aec710 100644
--- a/Website/interaction.js
+++ b/Website/interaction.js
@@ -33,9 +33,12 @@ const settingKomgaPass = document.querySelector("#komgaPassword");
const settingKavitaUrl = document.querySelector("#kavitaUrl");
const settingKavitaUser = document.querySelector("#kavitaUsername");
const settingKavitaPass = document.querySelector("#kavitaPassword");
+const settingGotifyUrl = document.querySelector("#gotifyUrl");
+const settingGotifyAppToken = document.querySelector("#gotifyAppToken");
const libraryUpdateTime = document.querySelector("#libraryUpdateTime");
const settingKomgaConfigured = document.querySelector("#komgaConfigured");
const settingKavitaConfigured = document.querySelector("#kavitaConfigured");
+const settingGotifyConfigured = document.querySelector("#gotifyConfigured");
const settingApiUri = document.querySelector("#settingApiUri");
const tagTasksRunning = document.querySelector("#tasksRunningTag");
const tagTasksQueued = document.querySelector("#tasksQueuedTag");
@@ -284,15 +287,19 @@ function GetSettingsClick(){
settingKomgaUrl.value = "";
settingKomgaUser.value = "";
settingKomgaPass.value = "";
+ settingKomgaConfigured.innerText = "❌";
settingKavitaUrl.value = "";
settingKavitaUser.value = "";
settingKavitaPass.value = "";
- settingKomgaConfigured.innerText = "❌";
settingKavitaConfigured.innerText = "❌";
+ settingGotifyUrl.value = "";
+ settingGotifyAppToken.value = "";
+ settingGotifyConfigured.innerText = "❌";
settingApiUri.placeholder = apiUri;
GetSettings().then(json => {
+ console.log(json);
settingDownloadLocation.innerText = json.downloadLocation;
json.libraryManagers.forEach(lm => {
if(lm.libraryType == 0){
@@ -307,6 +314,11 @@ function GetSettingsClick(){
settingKavitaConfigured.innerText = "✅";
}
});
+ json.notificationManagers.forEach(nm => {
+ if(nm.notificationManagerType == 0){
+ settingGotifyConfigured.innerText = "✅";
+ }
+ });
});
GetKomgaTask().then(json => {
@@ -316,19 +328,20 @@ function GetSettingsClick(){
}
function UpdateLibrarySettings(){
- if(settingKomgaUser.value != "" && settingKomgaPass != ""){
+ if(settingKomgaUrl.value != "" && settingKomgaUser.value != "" && settingKomgaPass != ""){
var auth = utf8_to_b64(`${settingKomgaUser.value}:${settingKomgaPass.value}`);
console.log(auth);
-
- if(settingKomgaUrl.value != "")
- UpdateSettings("", settingKomgaUrl.value, auth, "", "");
- else
- UpdateSettings("", settingKomgaUrl.placeholder, auth, "", "");
+ UpdateKomga(settingKomgaUrl.value, auth);
}
if(settingKavitaUrl.value != "" && settingKavitaUser.value != "" && settingKavitaPass.value != ""){
- UpdateSettings("", "", "", settingKavitaUrl.value, settingKavitaUser.value, settingKavitaPass.value);
+ UpdateKavita(settingKavitaUrl.value, settingKavitaUser.value, settingKavitaPass.value);
}
+
+ if(settingGotifyUrl.value != "" && settingGotifyAppToken.value != ""){
+ UpdateGotify(settingGotifyUrl.value, settingGotifyAppToken.value);
+ }
+
CreateUpdateLibraryTask(libraryUpdateTime.value);
setTimeout(() => GetSettingsClick(), 200);
}