diff --git a/dashboard/src/components/VolumesView.vue b/dashboard/src/components/VolumesView.vue index 4008cf9e8..0be1c50da 100644 --- a/dashboard/src/components/VolumesView.vue +++ b/dashboard/src/components/VolumesView.vue @@ -34,7 +34,7 @@ - + @@ -221,7 +221,7 @@ export default { v.message = status.message; } }, - openVolumeDialog(volume) { + async openVolumeDialog(volume) { this.volumeDialogData.error = null; this.volumeDialogData.mode = volume ? 'edit' : 'new'; this.volumeDialogData.id = volume ? volume.id : ''; @@ -236,6 +236,19 @@ export default { this.volumeDialogData.diskPath = volume ? volume.mountOptions.diskPath : ''; this.volumeDialogData.hostPath = volume ? volume.mountOptions.hostPath : ''; + let blockDevices = await volumesModel.getBlockDevices(); + + // only offer unmounted disks + blockDevices = blockDevices.filter(d => !d.mountpoint); + + // amend label for UI + blockDevices.forEach(d => d.label = d.path); + + this.volumeDialogData.ext4BlockDevices = blockDevices.filter(d => d.type === 'ext4'); + this.volumeDialogData.xfsBlockDevices = blockDevices.filter(d => d.type === 'xfs'); + + console.log(this.volumeDialogData.ext4BlockDevices, this.volumeDialogData.xfsBlockDevices) + this.$refs.volumeDialog.open(); }, async submitVolumeDialog() {