uptime-kuma/server/notification-providers/pushplus.js
Newton Langidrik 8cdf7a905a Rebrand to PSS Uptime: Add custom logo and favicon, update all references from Uptime Kuma to PSS Uptime
- Add custom logo.png and favicon.ico for Marshall Islands Public School System
- Update all application references from 'Uptime Kuma' to 'PSS Uptime'
- Update README.md with PSS Uptime branding and credits to original Uptime Kuma project
- Update Docker configuration to build from source
- Update all notification providers to use PSS Uptime branding
- Update UI components, layouts, and pages with new branding
- Update language files (en, zh-CN, zh-TW) with PSS Uptime translations
- Add logo URL input field in status page settings
- Update default icon references from icon.svg to logo.png
2026-01-20 13:47:09 +12:00

58 lines
1.9 KiB
JavaScript

const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class PushPlus extends NotificationProvider {
name = "PushPlus";
/**
* @inheritdoc
* @param {BeanModel} notification Notification object
* @param {string} msg Message content
* @param {?object} monitorJSON Monitor details
* @param {?object} heartbeatJSON Heartbeat details
* @returns {Promise<string>} Success message
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
const url = "https://www.pushplus.plus/send";
try {
let config = {
headers: {
"Content-Type": "application/json",
},
};
config = this.getAxiosConfigWithProxy(config);
const params = {
token: notification.pushPlusSendKey,
title: this.checkStatus(heartbeatJSON, monitorJSON),
content: msg,
template: "html",
};
await axios.post(url, params, config);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
/**
* Get the formatted title for message
* @param {?object} heartbeatJSON Heartbeat details (For Up/Down only)
* @param {?object} monitorJSON Monitor details (For Up/Down only)
* @returns {string} Formatted title
*/
checkStatus(heartbeatJSON, monitorJSON) {
let title = "PSS Uptime Message";
if (heartbeatJSON != null && heartbeatJSON["status"] === UP) {
title = "PSS Uptime Monitor Up " + monitorJSON["name"];
}
if (heartbeatJSON != null && heartbeatJSON["status"] === DOWN) {
title = "PSS Uptime Monitor Down " + monitorJSON["name"];
}
return title;
}
}
module.exports = PushPlus;