feat(notification): expose path vars and improve Slack rich message (#6690)

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
tellorian 2026-01-13 11:08:42 +09:00 committed by GitHub
parent 59af678eb9
commit 4de99eb851
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,6 +90,20 @@ class Slack extends NotificationProvider {
},
});
// Optional context line for monitor group path (excluding monitor name)
const groupPath = monitorJSON?.path?.length > 1 ? monitorJSON.path.slice(0, -1).join(" / ") : "";
if (groupPath) {
blocks.push({
type: "context",
elements: [
{
type: "mrkdwn",
text: `_${groupPath}_`,
},
],
});
}
// the body block, containing the details
blocks.push({
type: "section",
@ -142,7 +156,7 @@ class Slack extends NotificationProvider {
const baseURL = await setting("primaryBaseURL");
const title = "Uptime Kuma Alert";
const title = monitorJSON?.name || "Uptime Kuma Alert";
let data = {
text: msg,
channel: notification.slackchannel,