ui: Show diskoffering for create volume from ROOT volume snaps (#4912)

Fixes the issue of not being able to select the diskofferingid while creating volumes from snapshots of ROOT volumes
This commit is contained in:
davidjumani 2021-04-16 12:36:38 +05:30 committed by GitHub
parent 0302750aac
commit 90fc5acda4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,7 +284,13 @@ export default {
label: 'label.action.create.volume',
dataView: true,
show: (record) => { return record.state === 'BackedUp' },
args: ['snapshotid', 'name'],
args: (record, store) => {
var fields = ['snapshotid', 'name']
if (record.volumetype === 'ROOT') {
fields.push('diskofferingid')
}
return fields
},
mapping: {
snapshotid: {
value: (record) => { return record.id }