From fb50d5f77c9ba0c0debfe872b1d9f8c63777e887 Mon Sep 17 00:00:00 2001 From: Bas Wieringa Date: Fri, 12 Apr 2024 15:32:50 +0200 Subject: [PATCH] Change to show last heartbeat --- .../2024-03-15-0000-hide-uptime-percentage.js | 16 ---------------- .../2024-03-15-0000-show-last-heartbeat.js | 16 ++++++++++++++++ server/model/status_page.js | 4 ++-- .../status-page-socket-handler.js | 2 +- src/components/PublicGroupList.vue | 6 +++--- src/lang/en.json | 2 +- src/pages/StatusPage.vue | 8 ++++---- 7 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js create mode 100644 db/knex_migrations/2024-03-15-0000-show-last-heartbeat.js diff --git a/db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js b/db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js deleted file mode 100644 index 7d44fb522..000000000 --- a/db/knex_migrations/2024-03-15-0000-hide-uptime-percentage.js +++ /dev/null @@ -1,16 +0,0 @@ -exports.up = function (knex) { - // Add new column status_page.hide_uptime_percentage - return knex.schema - .alterTable("status_page", function (table) { - table.boolean("hide_uptime_percentage").notNullable().defaultTo(false); - }); - -}; - -exports.down = function (knex) { - // Drop column status_page.hide_uptime_percentage - return knex.schema - .alterTable("status_page", function (table) { - table.dropColumn("hide_uptime_percentage"); - }); -}; diff --git a/db/knex_migrations/2024-03-15-0000-show-last-heartbeat.js b/db/knex_migrations/2024-03-15-0000-show-last-heartbeat.js new file mode 100644 index 000000000..3ad545d2c --- /dev/null +++ b/db/knex_migrations/2024-03-15-0000-show-last-heartbeat.js @@ -0,0 +1,16 @@ +exports.up = function (knex) { + // Add new column status_page.show_last_heartbeat + return knex.schema + .alterTable("status_page", function (table) { + table.boolean("show_last_heartbeat").notNullable().defaultTo(false); + }); + +}; + +exports.down = function (knex) { + // Drop column status_page.show_last_heartbeat + return knex.schema + .alterTable("status_page", function (table) { + table.dropColumn("show_last_heartbeat"); + }); +}; diff --git a/server/model/status_page.js b/server/model/status_page.js index 01e4297da..26380e620 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -246,7 +246,7 @@ class StatusPage extends BeanModel { showPoweredBy: !!this.show_powered_by, googleAnalyticsId: this.google_analytics_tag_id, showCertificateExpiry: !!this.show_certificate_expiry, - hideUptimePercentage: !!this.hide_uptime_percentage + showLastHeartbeat: !!this.show_last_heartbeat }; } @@ -269,7 +269,7 @@ class StatusPage extends BeanModel { showPoweredBy: !!this.show_powered_by, googleAnalyticsId: this.google_analytics_tag_id, showCertificateExpiry: !!this.show_certificate_expiry, - hideUptimePercentage: !!this.hide_uptime_percentage + showLastHeartbeat: !!this.show_last_heartbeat }; } diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index d44b710a4..e641b14d5 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -163,7 +163,7 @@ module.exports.statusPageSocketHandler = (socket) => { statusPage.footer_text = config.footerText; statusPage.custom_css = config.customCSS; statusPage.show_powered_by = config.showPoweredBy; - statusPage.hide_uptime_percentage = config.hideUptimePercentage; + statusPage.show_last_heartbeat = config.showLastHeartbeat; 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 aa143c390..a36d81afc 100644 --- a/src/components/PublicGroupList.vue +++ b/src/components/PublicGroupList.vue @@ -38,7 +38,7 @@ - + {{ $t("showCertificateExpiry") }} - +
- - + +
@@ -325,7 +325,7 @@ 👀 {{ $t("statusPageNothing") }}
- +