[Status Page] WIP: Checkpoint

This commit is contained in:
LouisLam
2021-09-11 19:40:03 +08:00
parent 4b0a8087a2
commit 3e25f0e9d9
7 changed files with 159 additions and 18 deletions

View File

@@ -5,6 +5,8 @@ export default {
system: (window.matchMedia("(prefers-color-scheme: dark)").matches) ? "dark" : "light",
userTheme: localStorage.theme,
userHeartbeatBar: localStorage.heartbeatBarTheme,
statusPageTheme: "dark",
path: "",
};
},
@@ -25,14 +27,22 @@ export default {
computed: {
theme() {
if (this.userTheme === "auto") {
return this.system;
if (this.path === "/status-page") {
return this.statusPageTheme;
} else {
if (this.userTheme === "auto") {
return this.system;
}
return this.userTheme;
}
return this.userTheme;
}
},
watch: {
"$route.fullPath"(path) {
this.path = path;
},
userTheme(to, from) {
localStorage.theme = to;
},