From 68862c0b3f5b23f21b21fff43729e5d853bf33c2 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Tue, 1 Nov 2022 20:27:40 +0800 Subject: [PATCH] Fix Pushbullet do not handle general message correctly and fix name convention (Close #1890) --- server/notification-providers/pushbullet.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/notification-providers/pushbullet.js b/server/notification-providers/pushbullet.js index 7f7a1c8d0..1346655d0 100644 --- a/server/notification-providers/pushbullet.js +++ b/server/notification-providers/pushbullet.js @@ -19,26 +19,26 @@ class Pushbullet extends NotificationProvider { } }; if (heartbeatJSON == null) { - let testdata = { + let data = { "type": "note", "title": "Uptime Kuma Alert", - "body": "Testing Successful.", + "body": msg, }; - await axios.post(pushbulletUrl, testdata, config); + await axios.post(pushbulletUrl, data, config); } else if (heartbeatJSON["status"] === DOWN) { - let downdata = { + let downData = { "type": "note", "title": "UptimeKuma Alert: " + monitorJSON["name"], "body": "[🔴 Down] " + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"], }; - await axios.post(pushbulletUrl, downdata, config); + await axios.post(pushbulletUrl, downData, config); } else if (heartbeatJSON["status"] === UP) { - let updata = { + let upData = { "type": "note", "title": "UptimeKuma Alert: " + monitorJSON["name"], "body": "[✅ Up] " + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"], }; - await axios.post(pushbulletUrl, updata, config); + await axios.post(pushbulletUrl, upData, config); } return okMsg; } catch (error) {