diff --git a/server/notification-providers/linenotify.js b/server/notification-providers/linenotify.js deleted file mode 100644 index 30b2e800d..000000000 --- a/server/notification-providers/linenotify.js +++ /dev/null @@ -1,53 +0,0 @@ -const NotificationProvider = require("./notification-provider"); -const axios = require("axios"); -const qs = require("qs"); -const { DOWN, UP } = require("../../src/util"); - -class LineNotify extends NotificationProvider { - name = "LineNotify"; - - /** - * @inheritdoc - */ - async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { - const okMsg = "Sent Successfully."; - const url = "https://notify-api.line.me/api/notify"; - - try { - let config = { - headers: { - "Content-Type": "application/x-www-form-urlencoded", - "Authorization": "Bearer " + notification.lineNotifyAccessToken - } - }; - config = this.getAxiosConfigWithProxy(config); - if (heartbeatJSON == null) { - let testMessage = { - "message": msg, - }; - await axios.post(url, qs.stringify(testMessage), config); - } else if (heartbeatJSON["status"] === DOWN) { - let downMessage = { - "message": "\n[🔴 Down]\n" + - "Name: " + monitorJSON["name"] + " \n" + - heartbeatJSON["msg"] + "\n" + - `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` - }; - await axios.post(url, qs.stringify(downMessage), config); - } else if (heartbeatJSON["status"] === UP) { - let upMessage = { - "message": "\n[✅ Up]\n" + - "Name: " + monitorJSON["name"] + " \n" + - heartbeatJSON["msg"] + "\n" + - `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}` - }; - await axios.post(url, qs.stringify(upMessage), config); - } - return okMsg; - } catch (error) { - this.throwGeneralAxiosError(error); - } - } -} - -module.exports = LineNotify; diff --git a/server/notification.js b/server/notification.js index e25bca08b..555f10cc1 100644 --- a/server/notification.js +++ b/server/notification.js @@ -25,7 +25,6 @@ const HeiiOnCall = require("./notification-providers/heii-oncall"); const Keep = require("./notification-providers/keep"); const Kook = require("./notification-providers/kook"); const Line = require("./notification-providers/line"); -const LineNotify = require("./notification-providers/linenotify"); const LunaSea = require("./notification-providers/lunasea"); const Matrix = require("./notification-providers/matrix"); const Mattermost = require("./notification-providers/mattermost"); @@ -124,7 +123,6 @@ class Notification { new Keep(), new Kook(), new Line(), - new LineNotify(), new LunaSea(), new Matrix(), new Mattermost(), diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 98df20abb..9ed38e9cb 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -129,7 +129,6 @@ export default { "Keep": "Keep", "Kook": "Kook", "line": "LINE Messenger", - "LineNotify": "LINE Notify", "lunasea": "LunaSea", "matrix": "Matrix", "mattermost": "Mattermost", diff --git a/src/components/notifications/LineNotify.vue b/src/components/notifications/LineNotify.vue deleted file mode 100644 index 0f6897f46..000000000 --- a/src/components/notifications/LineNotify.vue +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/src/components/notifications/index.js b/src/components/notifications/index.js index 9bc4f050d..b0fa68342 100644 --- a/src/components/notifications/index.js +++ b/src/components/notifications/index.js @@ -24,7 +24,6 @@ import HeiiOnCall from "./HeiiOnCall.vue"; import Keep from "./Keep.vue"; import Kook from "./Kook.vue"; import Line from "./Line.vue"; -import LineNotify from "./LineNotify.vue"; import LunaSea from "./LunaSea.vue"; import Matrix from "./Matrix.vue"; import Mattermost from "./Mattermost.vue"; @@ -112,7 +111,6 @@ const NotificationFormList = { "Keep": Keep, "Kook": Kook, "line": Line, - "LineNotify": LineNotify, "lunasea": LunaSea, "matrix": Matrix, "mattermost": Mattermost,