If we have app.error we always have an app.error.details object

This commit is contained in:
Johannes Zellner
2025-07-23 15:40:25 +02:00
parent f03ac0133f
commit 68a8c964ea
6 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ async function onSubmit() {
busy.value = true;
formError.value = '';
const errorState = (appError.value && appError.value.details?.installationState) || ISTATES.PENDING_CONFIGURE;
const errorState = (appError.value && appError.value.details.installationState) || ISTATES.PENDING_CONFIGURE;
const data = {};
let repairFunc;
@@ -95,7 +95,7 @@ defineExpose({
fqdn.value = app.fqdn;
appError.value = app.error || null;
const errorState = (app.error && app.error.details?.installationState) || ISTATES.PENDING_CONFIGURE;
const errorState = (app.error && app.error.details.installationState) || ISTATES.PENDING_CONFIGURE;
if (errorState === ISTATES.PENDING_RESTORE || errorState === ISTATES.PENDING_IMPORT) {
const [error, result] = await appsModel.backups(app.id);
+2 -2
View File
@@ -185,7 +185,7 @@ onMounted(async () => {
<div>
<form @submit.prevent="onSubmit()" autocomplete="off" novalidate>
<fieldset :disabled="busy">
<input type="submit" style="display: none;" :disabled="(app.error && app.error.details?.installationState !== ISTATES.PENDING_LOCATION_CHANGE) || app.taskId || !formValid"/>
<input type="submit" style="display: none;" :disabled="(app.error && app.error.details.installationState !== ISTATES.PENDING_LOCATION_CHANGE) || app.taskId || !formValid"/>
<FormGroup>
<label>{{ $t('app.location.location') }}</label>
@@ -253,6 +253,6 @@ onMounted(async () => {
<br/>
<Checkbox v-if="needsOverwriteDns" v-model="overwriteDns" :label="$t('app.location.dnsoverwrite')"/>
<Button @click="onSubmit()" :loading="busy" :disabled="busy || (app.error && app.error.details?.installationState !== ISTATES.PENDING_LOCATION_CHANGE) || app.taskId || !formValid">{{ $t('app.location.saveAction') }}</Button>
<Button @click="onSubmit()" :loading="busy" :disabled="busy || (app.error && app.error.details.installationState !== ISTATES.PENDING_LOCATION_CHANGE) || app.taskId || !formValid">{{ $t('app.location.saveAction') }}</Button>
</div>
</template>
+2 -2
View File
@@ -68,7 +68,7 @@ onMounted(() => {
<label>{{ $t('app.repair.taskError.title') }}</label>
<p>{{ $t('app.repair.taskError.description') }}</p>
<p v-if="app.error">An error occurred during the <b>{{ taskNameFromInstallationState(app.error.details?.installationState) }}</b> operation: <span class="text-danger"><b>{{ app.error.reason + ': ' + app.error.message }}</b></span></p>
<Button @click="onRepair()" :disabled="app.taskId || !app.error" v-tooltip="app.taskId ? $t('app.repair.appIsBusyTooltip') : ''">{{ $t('app.repair.taskError.retryAction', { task: app.error ? taskNameFromInstallationState(app.error.details?.installationState) : '' }) }}</Button>
<p v-if="app.error">An error occurred during the <b>{{ taskNameFromInstallationState(app.error.details.installationState) }}</b> operation: <span class="text-danger"><b>{{ app.error.reason + ': ' + app.error.message }}</b></span></p>
<Button @click="onRepair()" :disabled="app.taskId || !app.error" v-tooltip="app.taskId ? $t('app.repair.appIsBusyTooltip') : ''">{{ $t('app.repair.taskError.retryAction', { task: app.error ? taskNameFromInstallationState(app.error.details.installationState) : '' }) }}</Button>
</div>
</template>
+2 -2
View File
@@ -19,7 +19,7 @@ const props = defineProps([ 'app' ]);
const latestBackup = ref(null);
function isAppStopped() {
if (props.app.error) {
if (props.app.error.details?.installationState === ISTATES.PENDING_START) return true;
if (props.app.error.details.installationState === ISTATES.PENDING_START) return true;
else return false;
} else if (props.app.installationState === ISTATES.PENDING_START || props.app.installationState === ISTATES.PENDING_STOP) {
return props.app.installationState === ISTATES.PENDING_START;
@@ -102,7 +102,7 @@ onMounted(async () => {
<label>{{ $t('app.uninstall.startStop.title') }}</label>
<p>{{ $t('app.uninstall.startStop.description') }}</p>
<Button @click="onToggleRunState()"
:disabled="toggleRunStateBusy || app.taskId || (app.error && (app.error.details?.installationState !== 'pending_start' && app.error.details?.installationState !== 'pending_stop')) || app.installationState === 'pending_start' || app.installationState === 'pending_stop'"
:disabled="toggleRunStateBusy || app.taskId || (app.error && (app.error.details.installationState !== 'pending_start' && app.error.details.installationState !== 'pending_stop')) || app.installationState === 'pending_start' || app.installationState === 'pending_stop'"
:loading="toggleRunStateBusy || app.installationState === 'pending_start' || app.installationState === 'pending_stop'"
>
{{ $t(isAppStopped() ? 'app.uninstall.startStop.startAction' : 'app.uninstall.startStop.stopAction') }}