added option for ntfy access tokens

pull/2905/head
Josua Frank 2 years ago
parent 2dedc1cfbd
commit e8814e8479

@ -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,

@ -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">

Loading…
Cancel
Save