mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-22 14:42:51 +08:00
Added user choice heartbeat bar
This commit is contained in:
@@ -4,6 +4,7 @@ export default {
|
||||
return {
|
||||
system: (window.matchMedia("(prefers-color-scheme: dark)").matches) ? "dark" : "light",
|
||||
userTheme: localStorage.theme,
|
||||
userHeartbeatBar: localStorage.heartbeatBarTheme
|
||||
};
|
||||
},
|
||||
|
||||
@@ -13,6 +14,11 @@ export default {
|
||||
this.userTheme = "light";
|
||||
}
|
||||
|
||||
//Default Heartbeat Bar
|
||||
if (! this.userHeartbeatBar) {
|
||||
this.userHeartbeatBar = "normal";
|
||||
}
|
||||
|
||||
document.body.classList.add(this.theme);
|
||||
this.updateThemeColorMeta();
|
||||
},
|
||||
@@ -35,6 +41,15 @@ export default {
|
||||
document.body.classList.remove(from);
|
||||
document.body.classList.add(this.theme);
|
||||
this.updateThemeColorMeta();
|
||||
},
|
||||
|
||||
userHeartbeatBar(to, from) {
|
||||
localStorage.heartbeatBarTheme = to;
|
||||
},
|
||||
|
||||
heartbeatBarTheme(to, from) {
|
||||
document.body.classList.remove(from);
|
||||
document.body.classList.add(this.heartbeatBarTheme);
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user