feat: add ntfy as notification method (#377)

This commit is contained in:
Miguel Ribeiro
2024-06-05 22:08:36 +02:00
committed by GitHub
parent 7217088bb0
commit 65edf0963b
29 changed files with 366 additions and 4 deletions
+37
View File
@@ -280,4 +280,41 @@ function testNotificationsDiscordButton() {
};
makeFetchCall('endpoints/notifications/testdiscordnotifications.php', data, button);
}
function testNotificationsNtfyButton() {
const button = document.getElementById("testNotificationsNtfy");
button.disabled = true;
const host = document.getElementById("ntfyhost").value;
const topic = document.getElementById("ntfytopic").value;
const headers = document.getElementById("ntfyheaders").value;
const data = {
host: host,
topic: topic,
headers: headers
};
makeFetchCall('endpoints/notifications/testntfynotifications.php', data, button);
}
function saveNotificationsNtfyButton() {
const button = document.getElementById("saveNotificationsNtfy");
button.disabled = true;
const enabled = document.getElementById("ntfyenabled").checked ? 1 : 0;
const host = document.getElementById("ntfyhost").value;
const topic = document.getElementById("ntfytopic").value;
const headers = document.getElementById("ntfyheaders").value;
const data = {
enabled: enabled,
host: host,
topic: topic,
headers: headers
};
makeFetchCall('endpoints/notifications/saventfynotifications.php', data, button);
}