From 9eb55be198bc566b955869b9e581ccc1ea5ee534 Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 2 May 2025 12:21:07 +0800 Subject: [PATCH] Update server/notification-providers/spugpush.js Co-authored-by: Frank Elsinga --- server/notification-providers/spugpush.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/server/notification-providers/spugpush.js b/server/notification-providers/spugpush.js index 61574cab9..f6b203252 100644 --- a/server/notification-providers/spugpush.js +++ b/server/notification-providers/spugpush.js @@ -16,7 +16,7 @@ class SpugPush extends NotificationProvider { "msg": heartbeatJSON["msg"], "duration": heartbeatJSON["duration"], "name": monitorJSON["name"], - "target": this.getTarget(monitorJSON), + "target": this.extractAddress(monitorJSON), }); return okMsg; @@ -25,24 +25,6 @@ class SpugPush extends NotificationProvider { this.throwGeneralAxiosError(error); } } - - /** - * Get the formatted target for message - * @param {object} monitorJSON Monitor details (For Up/Down only) - * @returns {string} Formatted target - */ - getTarget(monitorJSON) { - let target = "-"; - if (monitorJSON["hostname"]) { - target = monitorJSON["hostname"]; - if (monitorJSON["port"]) { - target += ":" + monitorJSON["port"]; - } - } else if (monitorJSON["url"]) { - target = monitorJSON["url"]; - } - return target; - } } module.exports = SpugPush;