Fix data directory form submission state and add volume label

This commit is contained in:
Johannes Zellner
2025-06-11 17:30:40 +02:00
parent 059547e37c
commit c95e267cdd
+10 -3
View File
@@ -20,6 +20,7 @@ const diskUsage = ref(-1);
const diskUsageDate = ref(0);
const volumeId = ref('');
const volumePrefix = ref('');
const originalVolumeId = ref('');
const selectedMountType = computed(() => {
const v = volumes.value.find(v => v.id === volumeId.value);
return v ? v.mountType : '';
@@ -45,6 +46,8 @@ async function onSubmitMove() {
return console.error(error);
}
originalVolumeId.value = volumeId.value;
moveBusy.value = false;
}
@@ -103,6 +106,7 @@ onMounted(async () => {
volumeId.value = props.app.storageVolumeId || DEFAULT_VOLUME_ID;
volumePrefix.value = props.app.storageVolumePrefix || '';
originalVolumeId.value = volumeId.value;
});
</script>
@@ -118,8 +122,11 @@ onMounted(async () => {
<fieldset :disabled="moveBusy || app.error || app.taskId">
<input type="submit" style="display: none"/>
<SingleSelect v-model="volumeId" :options="volumes" option-key="id" option-label="label"/>
<p class="text-warning" v-if="volumeId !== DEFAULT_VOLUME_ID && selectedMountType === 'mountpoint'" v-html="$t('app.storage.appdata.mountTypeWarning')"></p>
<FormGroup>
<label>{{ $t('app.storage.mounts.volume') }}</label>
<SingleSelect v-model="volumeId" :options="volumes" option-key="id" option-label="label"/>
<div class="text-warning" v-if="volumeId !== DEFAULT_VOLUME_ID && selectedMountType === 'mountpoint'" v-html="$t('app.storage.appdata.mountTypeWarning')"></div>
</FormGroup>
<FormGroup v-if="volumeId !== DEFAULT_VOLUME_ID">
<label for="volumePrefixInput">Subdirectory</label>
@@ -131,7 +138,7 @@ onMounted(async () => {
</FormGroup>
<br/>
<Button @click="onSubmitMove()" :loading="moveBusy" :disabled="moveBusy || app.error || app.taskId" v-tooltip="app.error ? 'App is in error state' : (app.taskId ? 'App is busy' : '')">{{ $t('app.storage.appdata.moveAction') }}</Button>
<Button @click="onSubmitMove()" :loading="moveBusy" :disabled="moveBusy || app.error || app.taskId || originalVolumeId === volumeId" v-tooltip="app.error ? 'App is in error state' : (app.taskId ? 'App is busy' : '')">{{ $t('app.storage.appdata.moveAction') }}</Button>
<hr>