From fa3d1a55d7c6f2924da24e73c7441615eeff8c80 Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 2 May 2025 14:45:57 +0800 Subject: [PATCH] Refactor SpugPush notification message formatting --- server/notification-providers/spugpush.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/notification-providers/spugpush.js b/server/notification-providers/spugpush.js index 33b7c9686..e84174f38 100644 --- a/server/notification-providers/spugpush.js +++ b/server/notification-providers/spugpush.js @@ -12,16 +12,18 @@ class SpugPush extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { let okMsg = "Sent Successfully."; try { - let formData = {msg} + let formData = { + msg + }; const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`; if (heartbeatJSON == null) { formData.title = "Uptime Kuma Message"; } else if (heartbeatJSON["status"] === UP) { formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`; - formData.msg = `[✅ Up] ${heartbeatJSON["msg"]}` + formData.msg = `[✅ Up] ${heartbeatJSON["msg"]}`; } else if (heartbeatJSON["status"] === DOWN) { formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`; - formData.msg = `[🔴 Down] ${heartbeatJSON["msg"]}` + formData.msg = `[🔴 Down] ${heartbeatJSON["msg"]}`; } await axios.post(apiUrl, formData);