Compare commits

...

8 commits

Author SHA1 Message Date
Jan K.
61ba9f6d3a
Merge ef70ed28db into be2faf64ce 2024-12-22 05:46:24 +00:00
Louis Lam
be2faf64ce
Clarify that BSD OSs are not supported (#5465)
Some checks failed
validate / json-yaml-validate (push) Has been cancelled
validate / validate (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
2024-12-22 13:46:13 +08:00
Louis Lam
0b76e19401
Clarify that BSD OSs are not supported 2024-12-22 13:45:19 +08:00
Jan K.
ef70ed28db
Merge branch 'louislam:master' into master 2024-12-15 13:28:25 +01:00
Jan K.
0b80487c3d
Merge branch 'master' into master 2024-11-21 07:27:50 +01:00
JanK
a6188da3bc inlined webhookURL 2024-11-16 10:11:46 +01:00
JanK
be2f4621d3 Renamed webhook, changed type to url, added link to Pumble Webhook Documentation 2024-11-16 10:11:15 +01:00
JanK
c697a47c9a Added Pumble Notification 2024-11-13 18:20:02 +01:00
6 changed files with 68 additions and 2 deletions

View file

@ -62,6 +62,7 @@ Requirements:
- Platform
- ✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc.
- ✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher
- ❌ FreeBSD / OpenBSD / NetBSD
- ❌ Replit / Heroku
- [Node.js](https://nodejs.org/en/download/) 18 / 20.4
- [npm](https://docs.npmjs.com/cli/) 9

View file

@ -0,0 +1,51 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { UP } = require("../../src/util");
class Pumble extends NotificationProvider {
name = "pumble";
/**
* @inheritDoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
if (heartbeatJSON === null && monitorJSON === null) {
// Test message
let data = {
"text": "Uptime Kuma Alert",
"attachments": [
{
"title": "Test Alert",
"text": msg,
"color": "#5BDD8B"
}
]
};
await axios.post(notification.webhookURL, data);
return okMsg;
}
let data = {
"text": "Uptime Kuma Alert",
"attachments": [
{
"title": `${monitorJSON["name"]} is ${heartbeatJSON["status"] === UP ? "up" : "down"}`,
"text": heartbeatJSON["msg"],
"color": (heartbeatJSON["status"] === UP ? "#5BDD8B" : "#DC3645"),
}
]
};
await axios.post(notification.webhookURL, data);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Pumble;

View file

@ -69,6 +69,7 @@ const Cellsynt = require("./notification-providers/cellsynt");
const Onesender = require("./notification-providers/onesender");
const Wpush = require("./notification-providers/wpush");
const SendGrid = require("./notification-providers/send-grid");
const Pumble = require("./notification-providers/pumble");
class Notification {
@ -154,7 +155,8 @@ class Notification {
new GtxMessaging(),
new Cellsynt(),
new Wpush(),
new SendGrid()
new SendGrid(),
new Pumble()
];
for (let item of list) {
if (! item.name) {

View file

@ -165,7 +165,8 @@ export default {
"whapi": "WhatsApp (Whapi)",
"gtxmessaging": "GtxMessaging",
"Cellsynt": "Cellsynt",
"SendGrid": "SendGrid"
"SendGrid": "SendGrid",
"pumble": "Pumble",
};
// Put notifications here if it's not supported in most regions or its documentation is not in English

View file

@ -0,0 +1,9 @@
<template>
<div class="mb-3">
<label for="pumble-webhook-url" class="form-label mb-2">{{ $t("Webhook URL") }}</label><span style="color: red;"><sup>*</sup></span>
<input id="pumble-webhook-url" v-model="$parent.notification.webhookURL" type="url" class="form-control" required>
</div>
<div class="mb-3">
<a href="https://pumble.com/help/integrations/add-pumble-apps/incoming-webhooks-for-pumble/" target="_blank">{{ $t("documentationOf", ["Pumble Webbhook"]) }}</a>
</div>
</template>

View file

@ -67,6 +67,7 @@ import Cellsynt from "./Cellsynt.vue";
import WPush from "./WPush.vue";
import SIGNL4 from "./SIGNL4.vue";
import SendGrid from "./SendGrid.vue";
import Pumble from "./Pumble.vue";
/**
* Manage all notification form.
@ -142,6 +143,7 @@ const NotificationFormList = {
"Cellsynt": Cellsynt,
"WPush": WPush,
"SendGrid": SendGrid,
"pumble": Pumble
};
export default NotificationFormList;