mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-06-13 07:17:53 +02:00
Website: Added connector NotificationManager LunaSea
Added Update Method for TrangaSettings for LunaSea #21
This commit is contained in:
@ -150,6 +150,12 @@ function UpdateGotify(gotifyUrl, gotifyAppToken){
|
||||
PostData(uri);
|
||||
}
|
||||
|
||||
function UpdateLunaSea(lunaseaWebhook){
|
||||
var uri = apiUri + "/Settings/Update?"
|
||||
uri += `&lunaseaWebhook=${lunaseaWebhook}`;
|
||||
PostData(uri);
|
||||
}
|
||||
|
||||
function DeleteTask(taskType, connectorName, publicationId){
|
||||
var uri = apiUri + `/Tasks/Delete?taskType=${taskType}&connectorName=${connectorName}&publicationId=${publicationId}`;
|
||||
DeleteData(uri);
|
||||
|
@ -139,6 +139,11 @@
|
||||
<label for="gotifyUrl"></label><input placeholder="URL" id="gotifyUrl" type="text">
|
||||
<label for="gotifyAppToken"></label><input placeholder="App-Token" id="gotifyAppToken" type="text">
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">LunaSea</span>
|
||||
<div>Configured: <span id="lunaseaConfigured">✅❌</span></div>
|
||||
<label for="lunaseaWebhook"></label><input placeholder="Webhook-Url" id="lunaseaWebhook" type="text">
|
||||
</div>
|
||||
<div>
|
||||
<label for="libraryUpdateTime" style="margin-right: 5px;">Update Time</label><input id="libraryUpdateTime" type="time" value="00:01:00" step="10">
|
||||
<input type="submit" value="Update" onclick="UpdateLibrarySettings()">
|
||||
|
@ -35,10 +35,12 @@ const settingKavitaUser = document.querySelector("#kavitaUsername");
|
||||
const settingKavitaPass = document.querySelector("#kavitaPassword");
|
||||
const settingGotifyUrl = document.querySelector("#gotifyUrl");
|
||||
const settingGotifyAppToken = document.querySelector("#gotifyAppToken");
|
||||
const settingLunaseaWebhook = document.querySelector("#lunaseaWebhook");
|
||||
const libraryUpdateTime = document.querySelector("#libraryUpdateTime");
|
||||
const settingKomgaConfigured = document.querySelector("#komgaConfigured");
|
||||
const settingKavitaConfigured = document.querySelector("#kavitaConfigured");
|
||||
const settingGotifyConfigured = document.querySelector("#gotifyConfigured");
|
||||
const settingLunaseaConfigured = document.querySelector("#lunaseaConfigured");
|
||||
const settingApiUri = document.querySelector("#settingApiUri");
|
||||
const tagTasksRunning = document.querySelector("#tasksRunningTag");
|
||||
const tagTasksQueued = document.querySelector("#tasksQueuedTag");
|
||||
@ -295,6 +297,8 @@ function GetSettingsClick(){
|
||||
settingGotifyUrl.value = "";
|
||||
settingGotifyAppToken.value = "";
|
||||
settingGotifyConfigured.innerText = "❌";
|
||||
settingLunaseaWebhook.value = "";
|
||||
settingLunaseaConfigured.innerText = "❌";
|
||||
|
||||
settingApiUri.placeholder = apiUri;
|
||||
|
||||
@ -317,7 +321,9 @@ function GetSettingsClick(){
|
||||
json.notificationManagers.forEach(nm => {
|
||||
if(nm.notificationManagerType == 0){
|
||||
settingGotifyConfigured.innerText = "✅";
|
||||
}
|
||||
} else if(nm.notificationManagerType == 1){
|
||||
settingLunaseaConfigured.innerText = "✅";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -342,6 +348,10 @@ function UpdateLibrarySettings(){
|
||||
UpdateGotify(settingGotifyUrl.value, settingGotifyAppToken.value);
|
||||
}
|
||||
|
||||
if(settingLunaseaWebhook.value != ""){
|
||||
UpdateLunaSea(settingLunaseaWebhook.value);
|
||||
}
|
||||
|
||||
CreateUpdateLibraryTask(libraryUpdateTime.value);
|
||||
setTimeout(() => GetSettingsClick(), 200);
|
||||
}
|
||||
|
Reference in New Issue
Block a user