From 1935da5b16af5afb8aca7084032435696847d70e Mon Sep 17 00:00:00 2001 From: Niyas Date: Sat, 17 Jul 2021 12:47:52 +0530 Subject: [PATCH 1/4] Slack Enhancements --- server/notification.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/server/notification.js b/server/notification.js index 99cc1568c..5639ae9c6 100644 --- a/server/notification.js +++ b/server/notification.js @@ -128,13 +128,17 @@ class Notification { } else if (notification.type === "slack") { try { 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) return true; } const time = heartbeatJSON["time"]; let data = { + "text": "Uptime Kuma Alert", + "channel":notification.slackchannel, + "username": notification.slackusername, + "icon_emoji": notification.slackiconemo, "blocks": [{ "type": "header", "text": { @@ -155,17 +159,17 @@ class Notification { ] }, { - "type": "actions", - "elements": [ - { - "type": "button", - "text": { + "type": "actions", + "elements": [ + { + "type": "button", + "text": { "type": "plain_text", "text": "Visit Uptime Kuma", }, - "value": "Uptime-Kuma", - "url": notification.slackbutton - } + "value": "Uptime-Kuma", + "url": "https://github.com/louislam/uptime-kuma" || notification.slackbutton + } ] } ] From 65b320d06b2ab84d5fc6705a8132f3c3f6106f20 Mon Sep 17 00:00:00 2001 From: Niyas Date: Sat, 17 Jul 2021 12:48:42 +0530 Subject: [PATCH 2/4] Slack Enhancements --- src/components/NotificationDialog.vue | 34 ++++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 159915177..3b7f87a99 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -191,15 +191,31 @@ From 829a2a191d90286b81b2059f45ab81bf61a49ebf Mon Sep 17 00:00:00 2001 From: Niyas Date: Sat, 17 Jul 2021 13:42:05 +0530 Subject: [PATCH 3/4] Footer center align --- src/layouts/Layout.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/Layout.vue b/src/layouts/Layout.vue index b9aca97f6..237f051bd 100644 --- a/src/layouts/Layout.vue +++ b/src/layouts/Layout.vue @@ -146,6 +146,7 @@ footer { font-size: 13px; margin-bottom: 30px; margin-left: 10px; + text-align: center; } From 01f2fccb2379e764c4b52a6c961532823fade815 Mon Sep 17 00:00:00 2001 From: Niyas Date: Sat, 17 Jul 2021 18:59:26 +0530 Subject: [PATCH 4/4] Update notification.js --- server/notification.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification.js b/server/notification.js index 5639ae9c6..aa32438a0 100644 --- a/server/notification.js +++ b/server/notification.js @@ -168,7 +168,7 @@ class Notification { "text": "Visit Uptime Kuma", }, "value": "Uptime-Kuma", - "url": "https://github.com/louislam/uptime-kuma" || notification.slackbutton + "url": notification.slackbutton || "https://github.com/louislam/uptime-kuma" } ] }