From 90593c0d7cf0122cb76b1d7f5f117f1cdc469231 Mon Sep 17 00:00:00 2001 From: mospell Date: Sun, 23 Nov 2025 17:18:09 +0100 Subject: [PATCH] added 'go-to' links to the remaining Discord notifications --- .../src/service/v1/infrastructure/notificationUtils.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/src/service/v1/infrastructure/notificationUtils.js b/server/src/service/v1/infrastructure/notificationUtils.js index 2051fb6a4..90251800c 100644 --- a/server/src/service/v1/infrastructure/notificationUtils.js +++ b/server/src/service/v1/infrastructure/notificationUtils.js @@ -114,12 +114,13 @@ class NotificationUtils { { name: "Monitor", value: monitor.name, inline: true }, { name: "URL", value: monitor.url, inline: false }, ]; + const goToIncidentField = { name: `Go to incident`, value: `${clientHost}/infrastructure/${monitor._id}` }; const formatDiscordAlert = { cpu: () => ({ title: "CPU alert", description: `Your current CPU usage (${(cpuUsage * 100).toFixed(0)}%) is above your threshold (${(cpuThreshold * 100).toFixed(0)}%)`, color: 15548997, - fields: monitorInfoFields, + fields: [...monitorInfoFields, goToIncidentField], footer: { text: "Checkmate" }, }), @@ -127,7 +128,7 @@ class NotificationUtils { title: "Memory alert", description: `Your current memory usage (${(memoryUsage * 100).toFixed(0)}%) is above your threshold (${(memoryThreshold * 100).toFixed(0)}%)`, color: 15548997, - fields: monitorInfoFields, + fields: [...monitorInfoFields, goToIncidentField], footer: { text: "Checkmate" }, }), @@ -143,10 +144,7 @@ class NotificationUtils { value: `${(d?.usage_percent * 100).toFixed(0)}%`, inline: true, })), - { - name: `Go to incident`, - value: `${clientHost}/infrastructure/${monitor._id}`, - }, + goToIncidentField, ], }), };