Add toggle to hide the uptime percentage on a statuspage

This commit is contained in:
Bas Wieringa
2024-03-15 15:54:29 +01:00
parent 0e3b3a9ab8
commit 201ac9245b
7 changed files with 42 additions and 4 deletions

View File

@@ -106,6 +106,7 @@ class Database {
"patch-notification-config.sql": true,
"patch-fix-kafka-producer-booleans.sql": true,
"patch-timeout.sql": true, // The last file so far converted to a knex migration file
"patch-add-hide-uptime-percentage.sql": true
};
/**

View File

@@ -246,6 +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
};
}
@@ -268,6 +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
};
}

View File

@@ -163,6 +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_certificate_expiry = config.showCertificateExpiry;
statusPage.modified_date = R.isoDateTime();
statusPage.google_analytics_tag_id = config.googleAnalyticsId;