Do not offer the default app data for volume mounts
This commit is contained in:
@@ -13,6 +13,7 @@ const volumesModel = VolumesModel.create();
|
||||
|
||||
const DEFAULT_VOLUME_ID = '__default__';
|
||||
|
||||
const appDataVolumes = ref([]);
|
||||
const volumes = ref([]);
|
||||
const moveBusy = ref(false);
|
||||
const moveError = ref('');
|
||||
@@ -22,7 +23,7 @@ const volumeId = ref('');
|
||||
const volumePrefix = ref('');
|
||||
const originalVolumeId = ref('');
|
||||
const selectedMountType = computed(() => {
|
||||
const v = volumes.value.find(v => v.id === volumeId.value);
|
||||
const v = appDataVolumes.value.find(v => v.id === volumeId.value);
|
||||
return v ? v.mountType : '';
|
||||
});
|
||||
|
||||
@@ -123,7 +124,7 @@ onMounted(async () => {
|
||||
// make a copy, cannot clone due to Proxy objects
|
||||
originalMounts.value = mounts.value.map(m => { return { volumeId: m.volumeId, readOnly: m.readOnly }; });
|
||||
|
||||
volumes.value = [{
|
||||
appDataVolumes.value = [{
|
||||
id: DEFAULT_VOLUME_ID,
|
||||
label: 'Default - /home/yellowtent/appsdata/<appId>',
|
||||
mountType: '',
|
||||
@@ -135,6 +136,14 @@ onMounted(async () => {
|
||||
};
|
||||
}));
|
||||
|
||||
volumes.value = result.map(v => {
|
||||
return {
|
||||
id: v.id,
|
||||
label: 'Volume - ' + v.name,
|
||||
mountType: v.mountType,
|
||||
};
|
||||
});
|
||||
|
||||
volumeId.value = props.app.storageVolumeId || DEFAULT_VOLUME_ID;
|
||||
volumePrefix.value = props.app.storageVolumePrefix || '';
|
||||
originalVolumeId.value = volumeId.value;
|
||||
@@ -155,7 +164,7 @@ onMounted(async () => {
|
||||
|
||||
<FormGroup>
|
||||
<label>{{ $t('app.storage.mounts.volume') }}</label>
|
||||
<SingleSelect v-model="volumeId" :options="volumes" option-key="id" option-label="label"/>
|
||||
<SingleSelect v-model="volumeId" :options="appDataVolumes" 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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user