Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Always mount the main app regardless of the error

天舟15372d22499a
diff --git a/frontend/src/AppError.vue b/frontend/src/AppError.vue
deleted file mode 100644
index 9b0a3a9579..0000000000
--- a/frontend/src/AppError.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-<template>
- <h1 class="m-4">
- Connecting server timeout. Make sure the server is running.
- </h1>
-</template>
-
-<script lang="ts">
-export default {
- name: "AppError",
- components: {},
- setup(props, ctx) {},
-};
-</script>
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 198635662e..e4a7df0a13 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -2,7 +2,6 @@ import { createApp } from "vue";
import axios from "axios";
import moment from "moment";
import App from "./App.vue";
-import AppError from "./AppError.vue";
import { store } from "./store";
import { router } from "./router";
import "./assets/css/inter.css";
@@ -125,65 +124,61 @@ axios.interceptors.response.use(
// We need to restore the basic info in order to perform route authentication.
// Even using the <suspense>, it's still too late, thus we do the fetch here.
-await Promise.all([
+// We use finally because we always want to mount the app regardless of the error.
+Promise.all([
store.dispatch("actuator/fetchInfo"),
store.dispatch("plan/fetchCurrentPlan"),
store.dispatch("auth/restoreUser"),
-])
- .then(() => {
- const app = createApp(App);
+]).finally(() => {
+ const app = createApp(App);
- // Allow template to access various function
- app.config.globalProperties.window = window;
- app.config.globalProperties.console = console;
- app.config.globalProperties.moment = moment;
- app.config.globalProperties.humanizeTs = humanizeTs;
- app.config.globalProperties.isDev = isDev();
- app.config.globalProperties.isRelease = isRelease();
- app.config.globalProperties.sizeToFit = sizeToFit;
- app.config.globalProperties.urlfy = urlfy;
- app.config.globalProperties.environmentName = environmentName;
- app.config.globalProperties.environmentSlug = environmentSlug;
- app.config.globalProperties.projectName = projectName;
- app.config.globalProperties.projectSlug = projectSlug;
- app.config.globalProperties.instanceName = instanceName;
- app.config.globalProperties.instanceSlug = instanceSlug;
- app.config.globalProperties.databaseSlug = databaseSlug;
- app.config.globalProperties.dataSourceSlug = dataSourceSlug;
+ // Allow template to access various function
+ app.config.globalProperties.window = window;
+ app.config.globalProperties.console = console;
+ app.config.globalProperties.moment = moment;
+ app.config.globalProperties.humanizeTs = humanizeTs;
+ app.config.globalProperties.isDev = isDev();
+ app.config.globalProperties.isRelease = isRelease();
+ app.config.globalProperties.sizeToFit = sizeToFit;
+ app.config.globalProperties.urlfy = urlfy;
+ app.config.globalProperties.environmentName = environmentName;
+ app.config.globalProperties.environmentSlug = environmentSlug;
+ app.config.globalProperties.projectName = projectName;
+ app.config.globalProperties.projectSlug = projectSlug;
+ app.config.globalProperties.instanceName = instanceName;
+ app.config.globalProperties.instanceSlug = instanceSlug;
+ app.config.globalProperties.databaseSlug = databaseSlug;
+ app.config.globalProperties.dataSourceSlug = dataSourceSlug;
- app
- // Need to use a directive on the element.
- // The normal hljs.initHighlightingOnLoad() won't work because router change would cause vue
- // to re-render the page and remove the event listener required for
- .directive("highlight", highlight)
- .directive("data-source-type", dataSourceType)
- .use(store)
- .use(router)
- .component("BBAlert", BBAlert)
- .component("BBAttention", BBAttention)
- .component("BBAvatar", BBAvatar)
- .component("BBButtonAdd", BBButtonAdd)
- .component("BBButtonConfirm", BBButtonConfirm)
- .component("BBCheckbox", BBCheckbox)
- .component("BBContextMenu", BBContextMenu)
- .component("BBModal", BBModal)
- .component("BBNotification", BBNotification)
- .component("BBOutline", BBOutline)
- .component("BBSelect", BBSelect)
- .component("BBStepBar", BBStepBar)
- .component("BBStepTab", BBStepTab)
- .component("BBSwitch", BBSwitch)
- .component("BBTab", BBTab)
- .component("BBTabPanel", BBTabPanel)
- .component("BBTable", BBTable)
- .component("BBTableCell", BBTableCell)
- .component("BBTableHeaderCell", BBTableHeaderCell)
- .component("BBTableSearch", BBTableSearch)
- .component("BBTabFilter", BBTabFilter)
- .component("BBTextField", BBTextField)
- .mount("#app");
- })
- .catch(() => {
- const app = createApp(AppError);
- app.mount("#app");
- });
+ app
+ // Need to use a directive on the element.
+ // The normal hljs.initHighlightingOnLoad() won't work because router change would cause vue
+ // to re-render the page and remove the event listener required for
+ .directive("highlight", highlight)
+ .directive("data-source-type", dataSourceType)
+ .use(store)
+ .use(router)
+ .component("BBAlert", BBAlert)
+ .component("BBAttention", BBAttention)
+ .component("BBAvatar", BBAvatar)
+ .component("BBButtonAdd", BBButtonAdd)
+ .component("BBButtonConfirm", BBButtonConfirm)
+ .component("BBCheckbox", BBCheckbox)
+ .component("BBContextMenu", BBContextMenu)
+ .component("BBModal", BBModal)
+ .component("BBNotification", BBNotification)
+ .component("BBOutline", BBOutline)
+ .component("BBSelect", BBSelect)
+ .component("BBStepBar", BBStepBar)
+ .component("BBStepTab", BBStepTab)
+ .component("BBSwitch", BBSwitch)
+ .component("BBTab", BBTab)
+ .component("BBTabPanel", BBTabPanel)
+ .component("BBTable", BBTable)
+ .component("BBTableCell", BBTableCell)
+ .component("BBTableHeaderCell", BBTableHeaderCell)
+ .component("BBTableSearch", BBTableSearch)
+ .component("BBTabFilter", BBTabFilter)
+ .component("BBTextField", BBTextField)
+ .mount("#app");
+});