From d977b0b8f0cdbdcdb101ea6bab0c7c066661afbb Mon Sep 17 00:00:00 2001 From: guguji5 <604821528@qq.com> Date: Tue, 27 May 2025 14:18:18 +0800 Subject: [PATCH] Flashduty IntegrationKey support Endpoint URL --- server/notification-providers/flashduty.js | 4 ++-- src/components/notifications/FlashDuty.vue | 7 +++++-- src/lang/be.json | 1 + src/lang/bg-BG.json | 1 + src/lang/cs-CZ.json | 1 + src/lang/de-CH.json | 1 + src/lang/de-DE.json | 1 + src/lang/en.json | 1 + src/lang/es-ES.json | 1 + src/lang/fa.json | 1 + src/lang/fi.json | 1 + src/lang/fr-FR.json | 1 + src/lang/ga.json | 1 + src/lang/hr-HR.json | 1 + src/lang/hu.json | 1 + src/lang/id-ID.json | 1 + src/lang/ja.json | 1 + src/lang/lt.json | 1 + src/lang/nb-NO.json | 1 + src/lang/nl-NL.json | 1 + src/lang/pl.json | 1 + src/lang/pt-BR.json | 1 + src/lang/ro.json | 1 + src/lang/ru-RU.json | 1 + src/lang/sv-SE.json | 1 + src/lang/tr-TR.json | 1 + src/lang/uk-UA.json | 1 + src/lang/yue.json | 1 + src/lang/zh-CN.json | 1 + src/lang/zh-HK.json | 1 + src/lang/zh-TW.json | 1 + 31 files changed, 36 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/flashduty.js b/server/notification-providers/flashduty.js index c340ed06f..bac6f07ca 100644 --- a/server/notification-providers/flashduty.js +++ b/server/notification-providers/flashduty.js @@ -73,13 +73,13 @@ class FlashDuty extends NotificationProvider { } const options = { method: "POST", - url: "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey, + url: notification.flashdutyIntegrationKey.startsWith("http") ? notification.flashdutyIntegrationKey : "https://api.flashcat.cloud/event/push/alert/standard?integration_key=" + notification.flashdutyIntegrationKey, headers: { "Content-Type": "application/json" }, data: { description: `[${title}] [${monitorInfo.name}] ${body}`, title, event_status: eventStatus || "Info", - alert_key: String(monitorInfo.id) || Math.random().toString(36).substring(7), + alert_key: monitorInfo.id ? String(monitorInfo.id) : Math.random().toString(36).substring(7), labels, } }; diff --git a/src/components/notifications/FlashDuty.vue b/src/components/notifications/FlashDuty.vue index a66ada013..36eeff5f1 100644 --- a/src/components/notifications/FlashDuty.vue +++ b/src/components/notifications/FlashDuty.vue @@ -1,7 +1,10 @@