system: return the mounted and unmounted block devices (as long as xfs or ext4)

This commit is contained in:
Girish Ramakrishnan
2025-09-23 17:30:09 +02:00
parent 8668ff8939
commit f92cdf36f5
7 changed files with 43 additions and 38 deletions

View File

@@ -163,6 +163,7 @@ async function openVolumeDialog(volume) {
const ext4BlockDevices = [], xfsBlockDevices = [];
for (const blockDevice of blockDevices) {
if (blockDevice.mountpoints.some((mountpoint) => mountpoint === '/' || mountpoint.startsWith('/home') || mountpoint.startsWith('/boot'))) continue;
blockDevice.label = blockDevice.path; // // amend label for UI
if (blockDevice.type === 'ext4') ext4BlockDevices.push(blockDevice);
else if (blockDevice.type === 'xfs') xfsBlockDevices.push(blockDevice);
@@ -295,8 +296,8 @@ onMounted(async () =>{
<FormGroup v-if="volumeDialogData.mountType === 'ext4' || volumeDialogData.mountType === 'xfs'">
<label for="volumeDiskPath">{{ $t('volumes.addVolumeDialog.diskPath') }}</label>
<SingleSelect id="volumeMountType" v-if="volumeDialogData.mountType === 'ext4'" v-model="volumeDialogData.diskPath" :options="volumeDialogData.ext4BlockDevices" option-label="label" option-key="path" :disabled="volumeDialogData.mode === 'edit'"/>
<SingleSelect id="volumeMountType" v-if="volumeDialogData.mountType === 'xfs'" v-model="volumeDialogData.diskPath" :options="volumeDialogData.xfsBlockDevices" option-label="label" option-key="path" :disabled="volumeDialogData.mode === 'edit'"/>
<SingleSelect id="volumeDiskPath" v-if="volumeDialogData.mountType === 'ext4'" v-model="volumeDialogData.diskPath" :options="volumeDialogData.ext4BlockDevices" option-label="label" option-key="path" :disabled="volumeDialogData.mode === 'edit'"/>
<SingleSelect id="volumeDiskPath" v-if="volumeDialogData.mountType === 'xfs'" v-model="volumeDialogData.diskPath" :options="volumeDialogData.xfsBlockDevices" option-label="label" option-key="path" :disabled="volumeDialogData.mode === 'edit'"/>
</FormGroup>
<FormGroup v-if="volumeDialogData.mountType === 'cifs' || volumeDialogData.mountType === 'nfs' || volumeDialogData.mountType === 'sshfs'">