2021-09-23 05:57:24 +00:00
|
|
|
<template>
|
2022-03-25 10:59:06 +00:00
|
|
|
<div>
|
2022-04-09 16:25:27 +00:00
|
|
|
<StatusPage v-if="statusPageSlug" :override-slug="statusPageSlug" />
|
2022-03-25 10:59:06 +00:00
|
|
|
</div>
|
2021-09-23 05:57:24 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from "axios";
|
2022-04-06 14:43:22 +00:00
|
|
|
import StatusPage from "./StatusPage.vue";
|
2021-09-23 05:57:24 +00:00
|
|
|
|
|
|
|
export default {
|
2022-04-06 14:43:22 +00:00
|
|
|
components: {
|
|
|
|
StatusPage,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
statusPageSlug: null,
|
|
|
|
};
|
|
|
|
},
|
2021-09-23 05:57:24 +00:00
|
|
|
async mounted() {
|
|
|
|
|
2022-04-06 14:43:22 +00: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-09 16:25:27 +00:00
|
|
|
} else if (res.type === "entryPage") { // Dev only. For production, the logic is in the server side
|
2022-04-06 14:43:22 +00:00
|
|
|
const entryPage = res.entryPage;
|
|
|
|
|
|
|
|
if (entryPage === "statusPage") {
|
|
|
|
this.$router.push("/status");
|
|
|
|
} else {
|
|
|
|
this.$router.push("/dashboard");
|
|
|
|
}
|
2021-09-23 05:57:24 +00:00
|
|
|
} else {
|
|
|
|
this.$router.push("/dashboard");
|
|
|
|
}
|
2022-04-06 14:43:22 +00:00
|
|
|
|
2021-09-23 05:57:24 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|