This commit is contained in:
Brandon Hubbard 2026-01-20 06:03:21 +00:00 committed by GitHub
commit 136ada3f3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,59 @@
const NotificationProvider = require("./notification-provider");
const axios = require("axios");
const { DOWN, UP } = require("../../src/util");
class Clickup extends NotificationProvider {
name = "clickup";
/**
* @inheritdoc
*/
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
const okMsg = "Sent Successfully.";
try {
let config = this.getAxiosConfigWithProxy({
headers: {
Authorization: notification.clickupToken,
"Content-Type": "application/json",
},
});
// Build the message
let title = "Uptime Kuma Alert";
if (monitorJSON && heartbeatJSON) {
if (heartbeatJSON["status"] === DOWN) {
title = `${monitorJSON["name"]} went down`;
} else if (heartbeatJSON["status"] === UP) {
title = `${monitorJSON["name"]} is back online`;
}
}
// Build message content
let content = msg;
if (heartbeatJSON) {
content += `\n\n**Time (${heartbeatJSON["timezone"]}):** ${heartbeatJSON["localDateTime"]}`;
}
let address = this.extractAddress(monitorJSON);
if (address && !notification.clickupDisableUrl) {
content += `\n**Address:** ${address}`;
}
// Construct the payload for Clickup Chat API
const data = {
text: `${title}\n${content}`,
};
// Send to the specified channel
const url = `https://api.clickup.com/api/v2/channel/${notification.clickupChannelId}/chat/message`;
await axios.post(url, data, config);
return okMsg;
} catch (error) {
this.throwGeneralAxiosError(error);
}
}
}
module.exports = Clickup;

View File

@ -7,6 +7,7 @@ const Apprise = require("./notification-providers/apprise");
const Bale = require("./notification-providers/bale");
const Bark = require("./notification-providers/bark");
const Bitrix24 = require("./notification-providers/bitrix24");
const Clickup = require("./notification-providers/clickup");
const ClickSendSMS = require("./notification-providers/clicksendsms");
const CallMeBot = require("./notification-providers/call-me-bot");
const SMSC = require("./notification-providers/smsc");
@ -108,6 +109,7 @@ class Notification {
new Bale(),
new Bark(),
new Bitrix24(),
new Clickup(),
new ClickSendSMS(),
new CallMeBot(),
new SMSC(),

View File

@ -214,6 +214,7 @@ export default {
let chatPlatforms = {
bale: "Bale",
Bitrix24: "Bitrix24",
clickup: "Clickup",
discord: "Discord",
GoogleChat: "Google Chat (Google Workspace)",
gorush: "Gorush",

View File

@ -0,0 +1,57 @@
<template>
<div class="mb-3">
<label for="clickup-token" class="form-label">
{{ $t("Clickup API Token") }}
<span style="color: red"><sup>*</sup></span>
</label>
<input
id="clickup-token"
v-model="$parent.notification.clickupToken"
type="password"
class="form-control"
required
autocomplete="off"
/>
<div class="form-text">
{{ $t("Clickup API Token Description") }}
</div>
</div>
<div class="mb-3">
<label for="clickup-channel-id" class="form-label">
{{ $t("Clickup Channel ID") }}
<span style="color: red"><sup>*</sup></span>
</label>
<input
id="clickup-channel-id"
v-model="$parent.notification.clickupChannelId"
type="text"
class="form-control"
required
autocomplete="false"
/>
<div class="form-text">
{{ $t("Clickup Channel ID Description") }}
</div>
</div>
<div class="mb-3">
<div class="form-check form-switch">
<input
id="clickup-disable-url"
v-model="$parent.notification.clickupDisableUrl"
type="checkbox"
class="form-check-input"
/>
<label for="clickup-disable-url" class="form-check-label">
{{ $t("Disable URL in Notification") }}
</label>
</div>
</div>
</template>
<script>
export default {
name: "Clickup",
};
</script>

View File

@ -5,6 +5,7 @@ import Apprise from "./Apprise.vue";
import Bale from "./Bale.vue";
import Bark from "./Bark.vue";
import Bitrix24 from "./Bitrix24.vue";
import Clickup from "./Clickup.vue";
import Notifery from "./Notifery.vue";
import ClickSendSMS from "./ClickSendSMS.vue";
import CallMeBot from "./CallMeBot.vue";
@ -95,6 +96,7 @@ const NotificationFormList = {
bale: Bale,
Bark: Bark,
Bitrix24: Bitrix24,
clickup: Clickup,
clicksendsms: ClickSendSMS,
CallMeBot: CallMeBot,
smsc: SMSC,

View File

@ -1048,6 +1048,10 @@
"Bitrix24 Webhook URL": "Bitrix24 Webhook URL",
"wayToGetBitrix24Webhook": "You can create a webhook by following the steps at {0}",
"bitrix24SupportUserID": "Enter your user ID in Bitrix24. You can find out the ID from the link by going to the user's profile.",
"Clickup API Token": "Clickup API Token",
"Clickup API Token Description": "You can create a personal access token in Clickup by going to Settings -> Apps & Integrations -> API -> Generate token",
"Clickup Channel ID": "Clickup Channel ID",
"Clickup Channel ID Description": "You can find the channel ID from the channel URL or by using the Clickup API",
"Saved.": "Saved.",
"authUserInactiveOrDeleted": "The user is inactive or deleted.",
"authInvalidToken": "Invalid Token.",