Skip to content

Commit

Permalink
.raw supported for all SRs type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajaa-BARHTAOUI committed Jun 30, 2023
1 parent b1bce3f commit e239ced
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/xo-web/src/xo-app/disk-import/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ const getInitialState = () => ({
})

const FILE_GROUP_TYPE = {
raw: ['.iso', '.vdi', '.img'],
other: ['.vmdk', '.vhd'],
// .raw is supported for all types of SRs
raw: ['.iso', '.raw'],
other: ['.vmdk', '.vhd', '.raw'],
}

const DiskImport = decorate([
Expand Down Expand Up @@ -66,7 +67,7 @@ const DiskImport = decorate([
file,
name,
sr: this.state.sr,
type: fileExtension === '.vdi' || fileExtension === '.img' ? 'raw' : fileExtension.slice(1),
type: fileExtension.slice(1),
vmdkData,
}
}
Expand Down Expand Up @@ -131,7 +132,7 @@ const DiskImport = decorate([
<div>
<Dropzone
onDrop={effects.handleDrop}
message={_('dropDisksFiles', { types: isSrIso ? ['ISO', 'RAW'] : ['VHD', 'VMDK'] })}
message={_('dropDisksFiles', { types: isSrIso ? ['ISO', 'RAW'] : ['VHD', 'VMDK', 'RAW'] })}
accept={isSrIso ? FILE_GROUP_TYPE.raw : FILE_GROUP_TYPE.other}
/>
{loadingDisks && <Icon icon='loading' />}
Expand Down

0 comments on commit e239ced

Please sign in to comment.