feat: allow the user to configure PushDeer Server URL
This commit is contained in:
parent
1d9a28e9ab
commit
d7e12dc92d
|
@ -8,7 +8,14 @@ class PushDeer extends NotificationProvider {
|
|||
|
||||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||
let okMsg = "Sent Successfully.";
|
||||
let pushdeerlink = "https://api2.pushdeer.com/message/push";
|
||||
let defaultServer = "https://api2.pushdeer.com";
|
||||
let endpoint = "/message/push";
|
||||
let pushdeerlink;
|
||||
if (notification.pushdeerServer) {
|
||||
pushdeerlink = `${notification.pushdeerServer}${endpoint}`;
|
||||
} else {
|
||||
pushdeerlink = `${defaultServer}${endpoint}`;
|
||||
}
|
||||
|
||||
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<template>
|
||||
<div class="mb-3">
|
||||
<label for="pushdeer-server" class="form-label">{{ $t("PushDeer Server URL") }}</label>
|
||||
<input id="pushdeer-server" v-model="$parent.notification.pushdeerServer" type="text" class="form-control" placeholder="https://api2.pushdeer.com">
|
||||
<div class="form-text">{{ $t("Leave blank to use the official server.") }}</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="pushdeer-key" class="form-label">{{ $t("PushDeer Key") }}</label>
|
||||
<HiddenInput id="pushdeer-key" v-model="$parent.notification.pushdeerKey" :required="true" autocomplete="new-password" placeholder="PDUxxxx"></HiddenInput>
|
||||
|
|
|
@ -697,6 +697,8 @@
|
|||
"onebotPrivateMessage": "Private",
|
||||
"onebotUserOrGroupId": "Group/User ID",
|
||||
"onebotSafetyTips": "For safety, must set access token",
|
||||
"PushDeer Server": "PushDeer Server",
|
||||
"Leave blank to use the official server": "Leave blank to use the official server",
|
||||
"PushDeer Key": "PushDeer Key",
|
||||
"wayToGetClickSendSMSToken": "You can get API Username and API Key from {0} .",
|
||||
"Custom Monitor Type": "Custom Monitor Type",
|
||||
|
|
Loading…
Reference in New Issue