From 5c83b1799202ebbf6175ad1793b38f2dd1bb8c0c Mon Sep 17 00:00:00 2001 From: broodroosterdev <31385368+broodroosterdev@users.noreply.github.com> Date: Tue, 25 Nov 2025 01:28:42 +0100 Subject: [PATCH] feat: Add toggle to hide the uptime percentage on a statuspage (#4587) Co-authored-by: Bas Wieringa Co-authored-by: Frank Elsinga --- ...025-10-24-0000-show-only-last-heartbeat.js | 15 ++++++++++++ server/model/status_page.js | 2 ++ .../status-page-socket-handler.js | 1 + src/components/PublicGroupList.vue | 23 +++++++++++++++++-- src/lang/en.json | 1 + src/pages/StatusPage.vue | 8 ++++++- 6 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 db/knex_migrations/2025-10-24-0000-show-only-last-heartbeat.js diff --git a/db/knex_migrations/2025-10-24-0000-show-only-last-heartbeat.js b/db/knex_migrations/2025-10-24-0000-show-only-last-heartbeat.js new file mode 100644 index 000000000..75d6fb77e --- /dev/null +++ b/db/knex_migrations/2025-10-24-0000-show-only-last-heartbeat.js @@ -0,0 +1,15 @@ +exports.up = function (knex) { + // Add new column status_page.show_only_last_heartbeat + return knex.schema + .alterTable("status_page", function (table) { + table.boolean("show_only_last_heartbeat").notNullable().defaultTo(false); + }); +}; + +exports.down = function (knex) { + // Drop column status_page.show_only_last_heartbeat + return knex.schema + .alterTable("status_page", function (table) { + table.dropColumn("show_only_last_heartbeat"); + }); +}; diff --git a/server/model/status_page.js b/server/model/status_page.js index 2f3511ec5..224441127 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -409,6 +409,7 @@ class StatusPage extends BeanModel { showPoweredBy: !!this.show_powered_by, googleAnalyticsId: this.google_analytics_tag_id, showCertificateExpiry: !!this.show_certificate_expiry, + showOnlyLastHeartbeat: !!this.show_only_last_heartbeat }; } @@ -432,6 +433,7 @@ class StatusPage extends BeanModel { showPoweredBy: !!this.show_powered_by, googleAnalyticsId: this.google_analytics_tag_id, showCertificateExpiry: !!this.show_certificate_expiry, + showOnlyLastHeartbeat: !!this.show_only_last_heartbeat }; } diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index 939f1b5a5..7fb93cfaf 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -164,6 +164,7 @@ module.exports.statusPageSocketHandler = (socket) => { statusPage.footer_text = config.footerText; statusPage.custom_css = config.customCSS; statusPage.show_powered_by = config.showPoweredBy; + statusPage.show_only_last_heartbeat = config.showOnlyLastHeartbeat; statusPage.show_certificate_expiry = config.showCertificateExpiry; statusPage.modified_date = R.isoDateTime(); statusPage.google_analytics_tag_id = config.googleAnalyticsId; diff --git a/src/components/PublicGroupList.vue b/src/components/PublicGroupList.vue index 5b7e859fa..975bbef6e 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -46,6 +46,7 @@ + +
+ + +
+
@@ -328,7 +334,7 @@ 👀 {{ $t("statusPageNothing") }}
- +