Add SpugPush notification provider

This commit is contained in:
vapao 2025-04-30 17:39:10 +08:00
parent 73c9e27b70
commit 0454f93508
2 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,9 @@ class SpugPush extends NotificationProvider {
name = "SpugPush"; name = "SpugPush";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
let okMsg = "Sent Successfully."; let okMsg = "Sent Successfully.";
try { try {
@ -25,11 +28,11 @@ class SpugPush extends NotificationProvider {
/** /**
* Get the formatted target for message * Get the formatted target for message
* @param {?Object} monitorJSON Monitor details (For Up/Down only) * @param {object} monitorJSON Monitor details (For Up/Down only)
* @returns {string} Formatted target * @returns {string} Formatted target
*/ */
getTarget(monitorJSON) { getTarget(monitorJSON) {
let target = '-' let target = "-";
if (monitorJSON["hostname"]) { if (monitorJSON["hostname"]) {
target = monitorJSON["hostname"]; target = monitorJSON["hostname"];
if (monitorJSON["port"]) { if (monitorJSON["port"]) {