mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-24 23:09:39 -05:00
Slack Enhancements
This commit is contained in:
parent
78f5d2cd8b
commit
1935da5b16
@ -128,13 +128,17 @@ class Notification {
|
|||||||
} else if (notification.type === "slack") {
|
} else if (notification.type === "slack") {
|
||||||
try {
|
try {
|
||||||
if (heartbeatJSON == null) {
|
if (heartbeatJSON == null) {
|
||||||
let data = {'text': "Uptime Kuma Slack testing successful."}
|
let data = {'text': "Uptime Kuma Slack testing successful.", 'channel': notification.slackchannel, 'username': notification.slackusername, 'icon_emoji': notification.slackiconemo}
|
||||||
let res = await axios.post(notification.slackwebhookURL, data)
|
let res = await axios.post(notification.slackwebhookURL, data)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const time = heartbeatJSON["time"];
|
const time = heartbeatJSON["time"];
|
||||||
let data = {
|
let data = {
|
||||||
|
"text": "Uptime Kuma Alert",
|
||||||
|
"channel":notification.slackchannel,
|
||||||
|
"username": notification.slackusername,
|
||||||
|
"icon_emoji": notification.slackiconemo,
|
||||||
"blocks": [{
|
"blocks": [{
|
||||||
"type": "header",
|
"type": "header",
|
||||||
"text": {
|
"text": {
|
||||||
@ -155,17 +159,17 @@ class Notification {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "actions",
|
"type": "actions",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"type": "button",
|
"type": "button",
|
||||||
"text": {
|
"text": {
|
||||||
"type": "plain_text",
|
"type": "plain_text",
|
||||||
"text": "Visit Uptime Kuma",
|
"text": "Visit Uptime Kuma",
|
||||||
},
|
},
|
||||||
"value": "Uptime-Kuma",
|
"value": "Uptime-Kuma",
|
||||||
"url": notification.slackbutton
|
"url": "https://github.com/louislam/uptime-kuma" || notification.slackbutton
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user