mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-27 22:49:42 -08:00
[status page] improve the entry
This commit is contained in:
parent
5f533b9091
commit
439f45d91e
|
@ -111,28 +111,15 @@ export default {
|
|||
},
|
||||
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
this.init();
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.init();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
async init() {
|
||||
if (this.$route.name === "root") {
|
||||
|
||||
let entryPage = (await axios.get("/api/entry-page")).data;
|
||||
|
||||
if (entryPage === "statusPage") {
|
||||
this.$router.push("/status-page");
|
||||
} else {
|
||||
this.$router.push("/dashboard");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@ let socket;
|
|||
|
||||
const noSocketIOPages = [
|
||||
"/status-page",
|
||||
"/"
|
||||
];
|
||||
|
||||
export default {
|
||||
|
|
|
@ -5,7 +5,7 @@ export default {
|
|||
system: (window.matchMedia("(prefers-color-scheme: dark)").matches) ? "dark" : "light",
|
||||
userTheme: localStorage.theme,
|
||||
userHeartbeatBar: localStorage.heartbeatBarTheme,
|
||||
statusPageTheme: "dark",
|
||||
statusPageTheme: "light",
|
||||
path: "",
|
||||
};
|
||||
},
|
||||
|
@ -27,6 +27,12 @@ export default {
|
|||
|
||||
computed: {
|
||||
theme() {
|
||||
|
||||
// Entry no need dark
|
||||
if (this.path === "") {
|
||||
return "light";
|
||||
}
|
||||
|
||||
if (this.path === "/status-page") {
|
||||
return this.statusPageTheme;
|
||||
} else {
|
||||
|
@ -72,5 +78,5 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
33
src/pages/Entry.vue
Normal file
33
src/pages/Entry.vue
Normal file
|
@ -0,0 +1,33 @@
|
|||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
||||
},
|
||||
|
||||
async mounted() {
|
||||
let entryPage = (await axios.get("/api/entry-page")).data;
|
||||
|
||||
if (entryPage === "statusPage") {
|
||||
this.$router.push("/status-page");
|
||||
} else {
|
||||
this.$router.push("/dashboard");
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
|
@ -9,20 +9,24 @@ import List from "./pages/List.vue";
|
|||
import Settings from "./pages/Settings.vue";
|
||||
import Setup from "./pages/Setup.vue";
|
||||
import StatusPage from "./pages/StatusPage.vue";
|
||||
import Entry from "./pages/Entry.vue";
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: "/",
|
||||
component: Entry,
|
||||
},
|
||||
{
|
||||
path: "/dashboard",
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
name: "root",
|
||||
path: "",
|
||||
component: Dashboard,
|
||||
children: [
|
||||
{
|
||||
name: "DashboardHome",
|
||||
path: "/dashboard",
|
||||
path: "",
|
||||
component: DashboardHome,
|
||||
children: [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue