2021-09-23 01:57:24 -04:00
|
|
|
<template>
|
2022-03-25 06:59:06 -04:00
|
|
|
<div>
|
2022-04-09 12:25:27 -04:00
|
|
|
<StatusPage v-if="statusPageSlug" :override-slug="statusPageSlug" />
|
2022-03-25 06:59:06 -04:00
|
|
|
</div>
|
2021-09-23 01:57:24 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from "axios";
|
2022-04-06 10:43:22 -04:00
|
|
|
import StatusPage from "./StatusPage.vue";
|
2021-09-23 01:57:24 -04:00
|
|
|
|
|
|
|
export default {
|
2022-04-06 10:43:22 -04:00
|
|
|
components: {
|
|
|
|
StatusPage,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
statusPageSlug: null,
|
|
|
|
};
|
|
|
|
},
|
2021-09-23 01:57:24 -04:00
|
|
|
async mounted() {
|
|
|
|
|
2022-04-06 10:43:22 -04:00
|
|
|
// There are only 2 cases that could come in here.
|
|
|
|
// 1. Matched status Page domain name
|
|
|
|
// 2. Vue Frontend Dev
|
|
|
|
let res = (await axios.get("/api/entry-page")).data;
|
|
|
|
|
|
|
|
if (res.type === "statusPageMatchedDomain") {
|
|
|
|
this.statusPageSlug = res.statusPageSlug;
|
2022-04-10 01:46:00 -04:00
|
|
|
this.$root.forceStatusPageTheme = true;
|
2022-04-06 10:43:22 -04:00
|
|
|
|
2022-04-09 12:25:27 -04:00
|
|
|
} else if (res.type === "entryPage") { // Dev only. For production, the logic is in the server side
|
2022-04-06 10:43:22 -04:00
|
|
|
const entryPage = res.entryPage;
|
|
|
|
|
|
|
|
if (entryPage === "statusPage") {
|
|
|
|
this.$router.push("/status");
|
|
|
|
} else {
|
|
|
|
this.$router.push("/dashboard");
|
|
|
|
}
|
2021-09-23 01:57:24 -04:00
|
|
|
} else {
|
|
|
|
this.$router.push("/dashboard");
|
|
|
|
}
|
2022-04-06 10:43:22 -04:00
|
|
|
|
2021-09-23 01:57:24 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|