mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-20 06:02:33 +02:00
Added Pumble Notification (#5781)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
f6444aacd2
commit
33f253f825
5 changed files with 62 additions and 0 deletions
48
server/notification-providers/pumble.js
Normal file
48
server/notification-providers/pumble.js
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
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) {
|
||||||
|
let data = {
|
||||||
|
"attachments": [
|
||||||
|
{
|
||||||
|
"title": "Uptime Kuma Alert",
|
||||||
|
"text": msg,
|
||||||
|
"color": "#5BDD8B"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
await axios.post(notification.webhookURL, data);
|
||||||
|
return okMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
"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;
|
|
@ -33,6 +33,7 @@ const Octopush = require("./notification-providers/octopush");
|
||||||
const OneBot = require("./notification-providers/onebot");
|
const OneBot = require("./notification-providers/onebot");
|
||||||
const Opsgenie = require("./notification-providers/opsgenie");
|
const Opsgenie = require("./notification-providers/opsgenie");
|
||||||
const PagerDuty = require("./notification-providers/pagerduty");
|
const PagerDuty = require("./notification-providers/pagerduty");
|
||||||
|
const Pumble = require("./notification-providers/pumble");
|
||||||
const FlashDuty = require("./notification-providers/flashduty");
|
const FlashDuty = require("./notification-providers/flashduty");
|
||||||
const PagerTree = require("./notification-providers/pagertree");
|
const PagerTree = require("./notification-providers/pagertree");
|
||||||
const PromoSMS = require("./notification-providers/promosms");
|
const PromoSMS = require("./notification-providers/promosms");
|
||||||
|
@ -127,6 +128,7 @@ class Notification {
|
||||||
new FlashDuty(),
|
new FlashDuty(),
|
||||||
new PagerTree(),
|
new PagerTree(),
|
||||||
new PromoSMS(),
|
new PromoSMS(),
|
||||||
|
new Pumble(),
|
||||||
new Pushbullet(),
|
new Pushbullet(),
|
||||||
new PushDeer(),
|
new PushDeer(),
|
||||||
new Pushover(),
|
new Pushover(),
|
||||||
|
|
|
@ -140,6 +140,7 @@ export default {
|
||||||
"Opsgenie": "Opsgenie",
|
"Opsgenie": "Opsgenie",
|
||||||
"PagerDuty": "PagerDuty",
|
"PagerDuty": "PagerDuty",
|
||||||
"PagerTree": "PagerTree",
|
"PagerTree": "PagerTree",
|
||||||
|
"pumble": "Pumble",
|
||||||
"pushbullet": "Pushbullet",
|
"pushbullet": "Pushbullet",
|
||||||
"PushByTechulus": "Push by Techulus",
|
"PushByTechulus": "Push by Techulus",
|
||||||
"pushover": "Pushover",
|
"pushover": "Pushover",
|
||||||
|
|
9
src/components/notifications/Pumble.vue
Normal file
9
src/components/notifications/Pumble.vue
Normal 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>
|
|
@ -36,6 +36,7 @@ import PagerDuty from "./PagerDuty.vue";
|
||||||
import FlashDuty from "./FlashDuty.vue";
|
import FlashDuty from "./FlashDuty.vue";
|
||||||
import PagerTree from "./PagerTree.vue";
|
import PagerTree from "./PagerTree.vue";
|
||||||
import PromoSMS from "./PromoSMS.vue";
|
import PromoSMS from "./PromoSMS.vue";
|
||||||
|
import Pumble from "./Pumble.vue";
|
||||||
import Pushbullet from "./Pushbullet.vue";
|
import Pushbullet from "./Pushbullet.vue";
|
||||||
import PushDeer from "./PushDeer.vue";
|
import PushDeer from "./PushDeer.vue";
|
||||||
import Pushover from "./Pushover.vue";
|
import Pushover from "./Pushover.vue";
|
||||||
|
@ -114,6 +115,7 @@ const NotificationFormList = {
|
||||||
"FlashDuty": FlashDuty,
|
"FlashDuty": FlashDuty,
|
||||||
"PagerTree": PagerTree,
|
"PagerTree": PagerTree,
|
||||||
"promosms": PromoSMS,
|
"promosms": PromoSMS,
|
||||||
|
"pumble": Pumble,
|
||||||
"pushbullet": Pushbullet,
|
"pushbullet": Pushbullet,
|
||||||
"PushByTechulus": TechulusPush,
|
"PushByTechulus": TechulusPush,
|
||||||
"PushDeer": PushDeer,
|
"PushDeer": PushDeer,
|
||||||
|
|
Loading…
Add table
Reference in a new issue