From 150607cc93681c46d7c636e65c2ddf6f576912cb Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Thu, 2 Mar 2023 07:26:26 +0800 Subject: [PATCH] Feat: Support auto theme in status pages --- server/socket-handlers/status-page-socket-handler.js | 2 +- src/mixins/theme.js | 3 +++ src/pages/StatusPage.vue | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/server/socket-handlers/status-page-socket-handler.js b/server/socket-handlers/status-page-socket-handler.js index 717aba9c..411bda55 100644 --- a/server/socket-handlers/status-page-socket-handler.js +++ b/server/socket-handlers/status-page-socket-handler.js @@ -276,7 +276,7 @@ module.exports.statusPageSocketHandler = (socket) => { let statusPage = R.dispense("status_page"); statusPage.slug = slug; statusPage.title = title; - statusPage.theme = "light"; + statusPage.theme = "auto"; statusPage.icon = ""; await R.store(statusPage); diff --git a/src/mixins/theme.js b/src/mixins/theme.js index 8d225267..2f7867df 100644 --- a/src/mixins/theme.js +++ b/src/mixins/theme.js @@ -39,6 +39,9 @@ export default { } if (this.path.startsWith("/status-page") || this.path.startsWith("/status")) { + if (this.statusPageTheme === "auto") { + return this.system; + } return this.statusPageTheme; } else { if (this.userTheme === "auto") { diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index edf32561..7c340f8b 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -34,9 +34,13 @@ -
- - +
+ +