Skip to content

Commit c0598ac

Browse files
authored
Flashduty IntegrationKey support Endpoint URL (#5859)
1 parent 839ead8 commit c0598ac

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

server/notification-providers/flashduty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ class FlashDuty extends NotificationProvider {
7373
}
7474
const options = {
7575
method: "POST",
76-
url: "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey,
76+
url: notification.flashdutyIntegrationKey.startsWith("http") ? notification.flashdutyIntegrationKey : "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey,
7777
headers: { "Content-Type": "application/json" },
7878
data: {
7979
description: `[${title}] [${monitorInfo.name}] ${body}`,
8080
title,
8181
event_status: eventStatus || "Info",
82-
alert_key: String(monitorInfo.id) || Math.random().toString(36).substring(7),
82+
alert_key: monitorInfo.id ? String(monitorInfo.id) : Math.random().toString(36).substring(7),
8383
labels,
8484
}
8585
};

src/components/notifications/FlashDuty.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<div class="mb-3">
3-
<label for="flashduty-integration-url" class="form-label">Integration Key</label>
4-
<HiddenInput id="flashduty-integration-url" v-model="$parent.notification.flashdutyIntegrationKey" autocomplete="false"></HiddenInput>
3+
<label for="flashduty-integration-url" class="form-label">{{ $t("FlashDuty Push URL") }} <span style="color: red;"><sup>*</sup></span></label>
4+
<HiddenInput id="flashduty-integration-url" v-model="$parent.notification.flashdutyIntegrationKey" autocomplete="false" :placeholder="$t('FlashDuty Push URL Placeholder')" />
5+
<div class="form-text">
6+
<p><span style="color: red;"><sup>*</sup></span>{{ $t("Required") }}</p>
7+
</div>
58
<i18n-t tag="div" keypath="wayToGetFlashDutyKey" class="form-text">
69
<a href="https://flashcat.cloud/product/flashduty?from=kuma" target="_blank">{{ $t("here") }}</a>
710
</i18n-t>
@@ -18,7 +21,6 @@
1821

1922
<script>
2023
import HiddenInput from "../HiddenInput.vue";
21-
2224
export default {
2325
components: {
2426
HiddenInput,

src/lang/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,10 @@
895895
"noGroupMonitorMsg": "Not Available. Create a Group Monitor First.",
896896
"Close": "Close",
897897
"Request Body": "Request Body",
898-
"wayToGetFlashDutyKey": "You can go to Channel -> (Select a Channel) -> Integrations -> Add a new integration' page, add a 'Uptime Kuma' to get a push address, copy the Integration Key in the address. For more information, please visit",
898+
"wayToGetFlashDutyKey": "To integrate Uptime Kuma with Flashduty: Go to Channels > Select a channel > Integrations > Add a new integration, choose Uptime Kuma, and copy the Push URL.",
899899
"FlashDuty Severity": "Severity",
900+
"FlashDuty Push URL": "Push URL",
901+
"FlashDuty Push URL Placeholder": "Copy from the alerting integration page",
900902
"nostrRelays": "Nostr relays",
901903
"nostrRelaysHelp": "One relay URL per line",
902904
"nostrSender": "Sender Private Key (nsec)",

0 commit comments

Comments
 (0)