diff --git a/frontend/components/Main.vue b/frontend/components/Main.vue index 7147d75c9c9f9e6eb886244dae2cde77b208a590..d596812300a520a75467fc5436e59ad11db165bd 100644 --- a/frontend/components/Main.vue +++ b/frontend/components/Main.vue @@ -42,13 +42,13 @@ function onScroll() { <v-col cols="auto"> <v-card flat color="transparent" :min-width="computedMinWidth" :max-width="props.fluid ? undefined : maxWidth"> - <v-alert v-if="runtimeConfig.public.displayMessage === true" class="my-5" type="warning" variant="tonal" border="start" prominent> + <v-alert v-if="runtimeConfig.public?.displayMessage === true" class="my-5" type="warning" variant="tonal" border="start" prominent> Following an electric maintenance in the datacenter, our web application is currently experiencing technical difficulties and may not be functioning as expected. Our technical team is working diligently to resolve the issue as soon as possible. We apologize for any inconvenience this may cause and appreciate your patience and understanding. </v-alert> - <v-alert v-if="runtimeConfig.public.maintenance.enabled === true" class="my-5" type="warning" variant="tonal" border="start" prominent> - {{ runtimeConfig.public.maintenance.message }} + <v-alert v-if="runtimeConfig.public?.maintenance?.enabled === true" class="my-5" type="warning" variant="tonal" border="start" prominent> + {{ runtimeConfig.public.maintenance?.message }} </v-alert> <slot /> diff --git a/frontend/middleware/maintenance.global.ts b/frontend/middleware/maintenance.global.ts index 634a73fba45ea68e6d76c82382fdd2d2eff273c2..295ff6ede346f2e12ccb29500513499caf2e551e 100644 --- a/frontend/middleware/maintenance.global.ts +++ b/frontend/middleware/maintenance.global.ts @@ -1,6 +1,7 @@ export default defineNuxtRouteMiddleware((to, from) => { const runtimeConfig = useRuntimeConfig() + const appConfig const isMaintenance = runtimeConfig?.public?.maintenance === true if (!isMaintenance) return; diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index c6ebe45bb342c3582bb25c55575f15b24758716c..86d6cbd341b39929beee9f36a84bfadde814f3fe 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -18,6 +18,7 @@ export default defineNuxtConfig({ dfApiPrefix: "/dfapi", version: pkg.version, displayMessage: false, + maintenance: false, } }, modules: [