Simplify validation for creating volume templates via UI (#9828)

Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
This commit is contained in:
Henrique Sato 2024-12-03 14:44:18 -03:00 committed by GitHub
parent da54234585
commit 666efc4b97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -251,9 +251,7 @@ export default {
label: 'label.action.create.template.from.volume',
dataView: true,
show: (record) => {
return !['Destroy', 'Destroyed', 'Expunging', 'Expunged', 'Migrating', 'Uploading', 'UploadError', 'Creating'].includes(record.state) &&
((record.type === 'ROOT' && record.vmstate === 'Stopped') ||
(record.type !== 'ROOT' && !record.virtualmachineid && !['Allocated', 'Uploaded'].includes(record.state)))
return record.state === 'Ready' && (record.vmstate === 'Stopped' || !record.virtualmachineid)
},
args: (record, store) => {
var fields = ['volumeid', 'name', 'displaytext', 'ostypeid', 'isdynamicallyscalable', 'requireshvm', 'passwordenabled']