146
146
<SplashScreen v-if =" splashSrc" :img-url =" splashSrc" :version =" version" />
147
147
<GlobalSearchComponent />
148
148
</v-main >
149
+ <v-snackbar
150
+ v-model =" showBackendError"
151
+ timeout =" -1"
152
+ variant =" text"
153
+ location =" top"
154
+ >
155
+ <v-alert type =" error" >Backend is unavailable</v-alert >
156
+ </v-snackbar >
149
157
</v-layout >
150
158
</template >
151
159
@@ -162,9 +170,10 @@ import SplashScreen from '@/components/general/SplashScreen.vue'
162
170
import GlobalSearchComponent from ' @/components/general/GlobalSearchComponent.vue'
163
171
164
172
import { configManager } from ' @/services/application-config'
165
- import { getResourcesStaticUrl } from ' @/lib/fews-config'
173
+ import { getResourcesStaticUrl , isBackendAvailable } from ' @/lib/fews-config'
166
174
import { StyleValue , nextTick } from ' vue'
167
175
import packageConfig from ' ../../package.json'
176
+ import { asyncComputed } from ' @vueuse/core'
168
177
169
178
const configStore = useConfigStore ()
170
179
const alertsStore = useAlertsStore ()
@@ -181,6 +190,11 @@ const logoSrc = ref('')
181
190
const splashSrc = ref <string >()
182
191
const appBarStyle = ref <StyleValue >()
183
192
const appBarColor = ref <string >(' ' )
193
+ const HEALTH_CHECK_TIMEOUT = 5000
194
+ const showBackendError = asyncComputed (
195
+ async () => ! (await isBackendAvailable (HEALTH_CHECK_TIMEOUT )),
196
+ false ,
197
+ )
184
198
185
199
function updateAppBarColor() {
186
200
appBarColor .value = getComputedStyle (document .body ).getPropertyValue (
0 commit comments