Change Pushdeer to PushDeer

This commit is contained in:
Louis Lam 2022-04-14 14:29:54 +08:00
parent 93c51504f9
commit fb0064082e
5 changed files with 10 additions and 10 deletions

View File

@ -2,9 +2,9 @@ const NotificationProvider = require("./notification-provider");
const axios = require("axios"); const axios = require("axios");
const { DOWN, UP } = require("../../src/util"); const { DOWN, UP } = require("../../src/util");
class Pushdeer extends NotificationProvider { class PushDeer extends NotificationProvider {
name = "Pushdeer"; name = "PushDeer";
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully."; let okMsg = "Sent Successfully.";
@ -36,7 +36,7 @@ class Pushdeer extends NotificationProvider {
this.throwGeneralAxiosError(error); this.throwGeneralAxiosError(error);
} }
if (res.data.content.result.length === 0) { if (res.data.content.result.length === 0) {
let error = "Invalid Pushdeer key"; let error = "Invalid PushDeer key";
this.throwGeneralAxiosError(error); this.throwGeneralAxiosError(error);
} else if (JSON.parse(res.data.content.result[0]).success != "ok") { } else if (JSON.parse(res.data.content.result[0]).success != "ok") {
let error = "Unknown error"; let error = "Unknown error";
@ -49,4 +49,4 @@ class Pushdeer extends NotificationProvider {
} }
} }
module.exports = Pushdeer; module.exports = PushDeer;

View File

@ -32,7 +32,7 @@ const GoogleChat = require("./notification-providers/google-chat");
const Gorush = require("./notification-providers/gorush"); const Gorush = require("./notification-providers/gorush");
const Alerta = require("./notification-providers/alerta"); const Alerta = require("./notification-providers/alerta");
const OneBot = require("./notification-providers/onebot"); const OneBot = require("./notification-providers/onebot");
const Pushdeer = require("./notification-providers/pushdeer"); const PushDeer = require("./notification-providers/pushdeer");
class Notification { class Notification {
@ -76,7 +76,7 @@ class Notification {
new Gorush(), new Gorush(),
new Alerta(), new Alerta(),
new OneBot(), new OneBot(),
new Pushdeer(), new PushDeer(),
]; ];
for (let item of list) { for (let item of list) {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="mb-3"> <div class="mb-3">
<label for="pushdeer-key" class="form-label">{{ $t("Pushdeer Key") }}</label> <label for="pushdeer-key" class="form-label">{{ $t("PushDeer Key") }}</label>
<HiddenInput id="pushdeer-key" v-model="$parent.notification.pushdeerKey" :required="true" autocomplete="one-time-code" placeholder="PDUxxxx"></HiddenInput> <HiddenInput id="pushdeer-key" v-model="$parent.notification.pushdeerKey" :required="true" autocomplete="one-time-code" placeholder="PDUxxxx"></HiddenInput>
</div> </div>

View File

@ -30,7 +30,7 @@ import GoogleChat from "./GoogleChat.vue";
import Gorush from "./Gorush.vue"; import Gorush from "./Gorush.vue";
import Alerta from "./Alerta.vue"; import Alerta from "./Alerta.vue";
import OneBot from "./OneBot.vue"; import OneBot from "./OneBot.vue";
import Pushdeer from "./Pushdeer.vue"; import PushDeer from "./PushDeer.vue";
/** /**
* Manage all notification form. * Manage all notification form.
@ -70,7 +70,7 @@ const NotificationFormList = {
"gorush": Gorush, "gorush": Gorush,
"alerta": Alerta, "alerta": Alerta,
"OneBot": OneBot, "OneBot": OneBot,
"Pushdeer": Pushdeer, "PushDeer": PushDeer,
}; };
export default NotificationFormList; export default NotificationFormList;

View File

@ -451,5 +451,5 @@ export default {
onebotPrivateMessage: "Private", onebotPrivateMessage: "Private",
onebotUserOrGroupId: "Group/User ID", onebotUserOrGroupId: "Group/User ID",
onebotSafetyTips: "For safety, must set access token", onebotSafetyTips: "For safety, must set access token",
"Pushdeer Key": "Pushdeer Key", "PushDeer Key": "PushDeer Key",
}; };