feat(notification): expose path vars and improve Slack rich message (#6690)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
59af678eb9
commit
4de99eb851
@ -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
|
// the body block, containing the details
|
||||||
blocks.push({
|
blocks.push({
|
||||||
type: "section",
|
type: "section",
|
||||||
@ -142,7 +156,7 @@ class Slack extends NotificationProvider {
|
|||||||
|
|
||||||
const baseURL = await setting("primaryBaseURL");
|
const baseURL = await setting("primaryBaseURL");
|
||||||
|
|
||||||
const title = "Uptime Kuma Alert";
|
const title = monitorJSON?.name || "Uptime Kuma Alert";
|
||||||
let data = {
|
let data = {
|
||||||
text: msg,
|
text: msg,
|
||||||
channel: notification.slackchannel,
|
channel: notification.slackchannel,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user