Show error message instead of pushing to Error view

This commit is contained in:
Bubka
2023-11-23 14:30:42 +01:00
parent ee02fb5d92
commit 0451888b84
4 changed files with 25 additions and 10 deletions

View File

@ -17,7 +17,7 @@
const listAdminSettings = ref(null)
onMounted(() => {
systemService.getSystemInfos().then(response => {
systemService.getSystemInfos({returnError: true}).then(response => {
infos.value = response.data.common
if (response.data.admin_settings) {
@ -28,6 +28,9 @@
userPreferences.value = response.data.user_preferences
}
})
.catch(() => {
infos.value = null
})
})
function copyToClipboard(data) {
@ -94,7 +97,7 @@
<h2 class="title is-5 has-text-grey-light">
{{ $t('commons.environment') }}
</h2>
<div class="about-debug box is-family-monospace is-size-7">
<div v-if="infos" class="about-debug box is-family-monospace is-size-7">
<button id="btnCopyEnvVars" :aria-label="$t('commons.copy_to_clipboard')" class="button is-like-text is-pulled-right is-small is-text" @click.stop="copyToClipboard(listInfos.innerText)">
<FontAwesomeIcon :icon="['fas', 'copy']" />
</button>
@ -102,6 +105,9 @@
<li v-for="(value, key) in infos" :value="value" :key="key"><b>{{key}}</b>: {{value}}</li>
</ul>
</div>
<div v-else-if="infos === null" class="about-debug box is-family-monospace is-size-7 has-text-warning-dark">
{{ $t('errors.error_during_data_fetching') }}
</div>
<h2 v-if="adminSettings" class="title is-5 has-text-grey-light">
{{ $t('settings.admin_settings') }}
</h2>