added option for ntfy access tokens

This commit is contained in:
Josua Frank 2023-03-08 13:28:02 +00:00
parent 2dedc1cfbd
commit e8814e8479
2 changed files with 10 additions and 0 deletions

View file

@ -13,6 +13,10 @@ class Ntfy extends NotificationProvider {
headers = { headers = {
"Authorization": "Basic " + Buffer.from(notification.ntfyusername + ":" + notification.ntfypassword).toString("base64"), "Authorization": "Basic " + Buffer.from(notification.ntfyusername + ":" + notification.ntfypassword).toString("base64"),
}; };
} else if (notification.ntfyaccesstoken) {
headers = {
"Authorization": "Bearer " + notification.ntfyaccesstoken,
};
} }
let data = { let data = {
"topic": notification.ntfytopic, "topic": notification.ntfytopic,

View file

@ -27,6 +27,12 @@
<HiddenInput id="ntfy-password" v-model="$parent.notification.ntfypassword" autocomplete="new-password"></HiddenInput> <HiddenInput id="ntfy-password" v-model="$parent.notification.ntfypassword" autocomplete="new-password"></HiddenInput>
</div> </div>
</div> </div>
<div class="mb-3">
<label for="ntfy-access-token" class="form-label">{{ $t("Access Token") }} ({{ $t("Optional") }})</label>
<div class="input-group mb-3">
<HiddenInput id="ntfy-access-token" v-model="$parent.notification.ntfyaccesstoken"></HiddenInput>
</div>
</div>
<div class="mb-3"> <div class="mb-3">
<label for="ntfy-icon" class="form-label">{{ $t("IconUrl") }}</label> <label for="ntfy-icon" class="form-label">{{ $t("IconUrl") }}</label>
<input id="ntfy-icon" v-model="$parent.notification.ntfyIcon" type="text" class="form-control"> <input id="ntfy-icon" v-model="$parent.notification.ntfyIcon" type="text" class="form-control">