diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index 4c3b1ee55..0c08c2326 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -121,17 +121,17 @@ class Discord extends NotificationProvider { let wentOfflineFormatted = null; if (heartbeatJSON["lastDownTime"]) { const wentOfflineTimestamp = Math.floor(new Date(heartbeatJSON["lastDownTime"]).getTime() / 1000); - wentOfflineFormatted = ``; + wentOfflineFormatted = ``; // Calculate the actual duration between went offline and back online const durationSeconds = backOnlineTimestamp - wentOfflineTimestamp; - + // Format duration as human-readable string (e.g., "1h 23m", "45m 30s") // TODO: Update below to Intl.DurationFormat("en", { style: "short" }).format(duration) once we are on a newer node version const hours = Math.floor(durationSeconds / 3600); const minutes = Math.floor((durationSeconds % 3600) / 60); const seconds = durationSeconds % 60; - + const durationParts = []; if (hours > 0) { durationParts.push(`${hours}h`); @@ -143,7 +143,7 @@ class Discord extends NotificationProvider { // Only show seconds if less than an hour durationParts.push(`${seconds}s`); } - + downtimeDuration = durationParts.length > 0 ? durationParts.join(" ") : "0s"; } diff --git a/src/lang/en.json b/src/lang/en.json index ea1ea35a8..4c8ebffa8 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -39,7 +39,7 @@ "General Monitor Type": "General Monitor Type", "Passive Monitor Type": "Passive Monitor Type", "Specific Monitor Type": "Specific Monitor Type", - "markdownSupported": "Markdown syntax supported", + "markdownSupported": "Markdown syntax supported. If using HTML, avoid leading spaces to prevent formatting issues.", "pauseDashboardHome": "Pause", "Pause": "Pause", "Name": "Name", diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 1de5c5063..db9fbfb89 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -25,9 +25,7 @@ class="form-control" data-testid="description-input" > -
- {{ $t("markdownSupported") }} -
+
{{ $t("markdownSupported") }}
@@ -39,9 +37,7 @@ class="form-control" data-testid="footer-text-input" > -
- {{ $t("markdownSupported") }} -
+
{{ $t("markdownSupported") }}