mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-06-01 11:22:34 +02:00
Update server/notification-providers/spugpush.js
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
fc8edf0618
commit
9eb55be198
1 changed files with 1 additions and 19 deletions
|
@ -16,7 +16,7 @@ class SpugPush extends NotificationProvider {
|
||||||
"msg": heartbeatJSON["msg"],
|
"msg": heartbeatJSON["msg"],
|
||||||
"duration": heartbeatJSON["duration"],
|
"duration": heartbeatJSON["duration"],
|
||||||
"name": monitorJSON["name"],
|
"name": monitorJSON["name"],
|
||||||
"target": this.getTarget(monitorJSON),
|
"target": this.extractAddress(monitorJSON),
|
||||||
});
|
});
|
||||||
|
|
||||||
return okMsg;
|
return okMsg;
|
||||||
|
@ -25,24 +25,6 @@ class SpugPush extends NotificationProvider {
|
||||||
this.throwGeneralAxiosError(error);
|
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;
|
module.exports = SpugPush;
|
||||||
|
|
Loading…
Add table
Reference in a new issue