mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-21 14:08:02 +08:00
Database Setup Page (#2738)
* WIP * WIP: Database setup process * Add database setup page
This commit is contained in:
@@ -19,25 +19,33 @@ export default {
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
// There are only 2 cases that could come in here.
|
||||
// There are only 3 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;
|
||||
// 3. Vue Frontend Dev (not setup database yet)
|
||||
let res;
|
||||
try {
|
||||
res = (await axios.get("/api/entry-page")).data;
|
||||
|
||||
if (res.type === "statusPageMatchedDomain") {
|
||||
this.statusPageSlug = res.statusPageSlug;
|
||||
this.$root.forceStatusPageTheme = true;
|
||||
if (res.type === "statusPageMatchedDomain") {
|
||||
this.statusPageSlug = res.statusPageSlug;
|
||||
this.$root.forceStatusPageTheme = true;
|
||||
|
||||
} else if (res.type === "entryPage") { // Dev only. For production, the logic is in the server side
|
||||
const entryPage = res.entryPage;
|
||||
} else if (res.type === "entryPage") { // Dev only. For production, the logic is in the server side
|
||||
const entryPage = res.entryPage;
|
||||
|
||||
if (entryPage === "statusPage") {
|
||||
this.$router.push("/status");
|
||||
if (entryPage === "statusPage") {
|
||||
this.$router.push("/status");
|
||||
} else {
|
||||
this.$router.push("/dashboard");
|
||||
}
|
||||
} else if (res.type === "setup-database") {
|
||||
this.$router.push("/setup-database");
|
||||
} else {
|
||||
this.$router.push("/dashboard");
|
||||
}
|
||||
} else {
|
||||
this.$router.push("/dashboard");
|
||||
} catch (e) {
|
||||
alert("Cannot connect to the backend server. Did you start the backend server? (npm run start-server-dev)");
|
||||
}
|
||||
|
||||
},
|
||||
|
Reference in New Issue
Block a user