Website: Added gotify config
This commit is contained in:
parent
25c90782dc
commit
d9ced11cd1
@ -126,17 +126,27 @@ function EnqueueTask(taskType, connectorName, publicationId){
|
|||||||
PostData(uri);
|
PostData(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateSettings(downloadLocation, komgaUrl, komgaAuth, kavitaUrl, kavitaUser, kavitaPass){
|
function UpdateDownloadLocation(downloadLocation){
|
||||||
var uri = apiUri + "/Settings/Update?"
|
var uri = apiUri + "/Settings/Update?"
|
||||||
if(downloadLocation != ""){
|
uri += "&downloadLocation="+downloadLocation;
|
||||||
uri += "&downloadLocation="+downloadLocation;
|
PostData(uri);
|
||||||
}
|
}
|
||||||
if(komgaUrl != "" && komgaAuth != ""){
|
|
||||||
uri += `&komgaUrl=${komgaUrl}&komgaAuth=${komgaAuth}`;
|
function UpdateKomga(komgaUrl, komgaAuth){
|
||||||
}
|
var uri = apiUri + "/Settings/Update?"
|
||||||
if(kavitaUrl != "" && kavitaUser != "" && kavitaPass != ""){
|
uri += `&komgaUrl=${komgaUrl}&komgaAuth=${komgaAuth}`;
|
||||||
uri += `&kavitaUrl=${kavitaUrl}&kavitaUsername=${kavitaUser}&kavitaPassword=${kavitaPass}`;
|
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);
|
PostData(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,12 @@
|
|||||||
<label for="kavitaUsername"></label><input placeholder="Username" id="kavitaUsername" type="text">
|
<label for="kavitaUsername"></label><input placeholder="Username" id="kavitaUsername" type="text">
|
||||||
<label for="kavitaPassword"></label><input placeholder="Password" id="kavitaPassword" type="password">
|
<label for="kavitaPassword"></label><input placeholder="Password" id="kavitaPassword" type="password">
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">Gotify</span>
|
||||||
|
<div>Configured: <span id="gotifyConfigured">✅❌</span></div>
|
||||||
|
<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>
|
<div>
|
||||||
<label for="libraryUpdateTime" style="margin-right: 5px;">Update Time</label><input id="libraryUpdateTime" type="time" value="00:01:00" step="10">
|
<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()">
|
<input type="submit" value="Update" onclick="UpdateLibrarySettings()">
|
||||||
|
@ -33,9 +33,12 @@ const settingKomgaPass = document.querySelector("#komgaPassword");
|
|||||||
const settingKavitaUrl = document.querySelector("#kavitaUrl");
|
const settingKavitaUrl = document.querySelector("#kavitaUrl");
|
||||||
const settingKavitaUser = document.querySelector("#kavitaUsername");
|
const settingKavitaUser = document.querySelector("#kavitaUsername");
|
||||||
const settingKavitaPass = document.querySelector("#kavitaPassword");
|
const settingKavitaPass = document.querySelector("#kavitaPassword");
|
||||||
|
const settingGotifyUrl = document.querySelector("#gotifyUrl");
|
||||||
|
const settingGotifyAppToken = document.querySelector("#gotifyAppToken");
|
||||||
const libraryUpdateTime = document.querySelector("#libraryUpdateTime");
|
const libraryUpdateTime = document.querySelector("#libraryUpdateTime");
|
||||||
const settingKomgaConfigured = document.querySelector("#komgaConfigured");
|
const settingKomgaConfigured = document.querySelector("#komgaConfigured");
|
||||||
const settingKavitaConfigured = document.querySelector("#kavitaConfigured");
|
const settingKavitaConfigured = document.querySelector("#kavitaConfigured");
|
||||||
|
const settingGotifyConfigured = document.querySelector("#gotifyConfigured");
|
||||||
const settingApiUri = document.querySelector("#settingApiUri");
|
const settingApiUri = document.querySelector("#settingApiUri");
|
||||||
const tagTasksRunning = document.querySelector("#tasksRunningTag");
|
const tagTasksRunning = document.querySelector("#tasksRunningTag");
|
||||||
const tagTasksQueued = document.querySelector("#tasksQueuedTag");
|
const tagTasksQueued = document.querySelector("#tasksQueuedTag");
|
||||||
@ -284,15 +287,19 @@ function GetSettingsClick(){
|
|||||||
settingKomgaUrl.value = "";
|
settingKomgaUrl.value = "";
|
||||||
settingKomgaUser.value = "";
|
settingKomgaUser.value = "";
|
||||||
settingKomgaPass.value = "";
|
settingKomgaPass.value = "";
|
||||||
|
settingKomgaConfigured.innerText = "❌";
|
||||||
settingKavitaUrl.value = "";
|
settingKavitaUrl.value = "";
|
||||||
settingKavitaUser.value = "";
|
settingKavitaUser.value = "";
|
||||||
settingKavitaPass.value = "";
|
settingKavitaPass.value = "";
|
||||||
settingKomgaConfigured.innerText = "❌";
|
|
||||||
settingKavitaConfigured.innerText = "❌";
|
settingKavitaConfigured.innerText = "❌";
|
||||||
|
settingGotifyUrl.value = "";
|
||||||
|
settingGotifyAppToken.value = "";
|
||||||
|
settingGotifyConfigured.innerText = "❌";
|
||||||
|
|
||||||
settingApiUri.placeholder = apiUri;
|
settingApiUri.placeholder = apiUri;
|
||||||
|
|
||||||
GetSettings().then(json => {
|
GetSettings().then(json => {
|
||||||
|
console.log(json);
|
||||||
settingDownloadLocation.innerText = json.downloadLocation;
|
settingDownloadLocation.innerText = json.downloadLocation;
|
||||||
json.libraryManagers.forEach(lm => {
|
json.libraryManagers.forEach(lm => {
|
||||||
if(lm.libraryType == 0){
|
if(lm.libraryType == 0){
|
||||||
@ -307,6 +314,11 @@ function GetSettingsClick(){
|
|||||||
settingKavitaConfigured.innerText = "✅";
|
settingKavitaConfigured.innerText = "✅";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
json.notificationManagers.forEach(nm => {
|
||||||
|
if(nm.notificationManagerType == 0){
|
||||||
|
settingGotifyConfigured.innerText = "✅";
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
GetKomgaTask().then(json => {
|
GetKomgaTask().then(json => {
|
||||||
@ -316,19 +328,20 @@ function GetSettingsClick(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function UpdateLibrarySettings(){
|
function UpdateLibrarySettings(){
|
||||||
if(settingKomgaUser.value != "" && settingKomgaPass != ""){
|
if(settingKomgaUrl.value != "" && settingKomgaUser.value != "" && settingKomgaPass != ""){
|
||||||
var auth = utf8_to_b64(`${settingKomgaUser.value}:${settingKomgaPass.value}`);
|
var auth = utf8_to_b64(`${settingKomgaUser.value}:${settingKomgaPass.value}`);
|
||||||
console.log(auth);
|
console.log(auth);
|
||||||
|
UpdateKomga(settingKomgaUrl.value, auth);
|
||||||
if(settingKomgaUrl.value != "")
|
|
||||||
UpdateSettings("", settingKomgaUrl.value, auth, "", "");
|
|
||||||
else
|
|
||||||
UpdateSettings("", settingKomgaUrl.placeholder, auth, "", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(settingKavitaUrl.value != "" && settingKavitaUser.value != "" && settingKavitaPass.value != ""){
|
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);
|
CreateUpdateLibraryTask(libraryUpdateTime.value);
|
||||||
setTimeout(() => GetSettingsClick(), 200);
|
setTimeout(() => GetSettingsClick(), 200);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user