diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 03d68b1a5e8..e411538139a 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -387,11 +387,14 @@ export default { docHelp: 'adminguide/virtual_machines.html#deleting-vms', dataView: true, groupAction: true, - args: ['expunge'], + args: (record, store, group) => { + return (['Admin'].includes(store.userInfo.roletype) || store.features.allowuserexpungerecovervm) + ? ['expunge'] : [] + }, popup: true, groupMap: (selection, values) => { return selection.map(x => { return { id: x, expunge: values.expunge } }) }, show: (record) => { return ['Running', 'Stopped', 'Error'].includes(record.state) }, - component: () => import('@/views/compute/DestoryVM.vue') + component: () => import('@/views/compute/DestroyVM.vue') } ] }, diff --git a/ui/src/config/section/storage.js b/ui/src/config/section/storage.js index 73337f1f47e..794906194d3 100644 --- a/ui/src/config/section/storage.js +++ b/ui/src/config/section/storage.js @@ -237,7 +237,8 @@ export default { message: 'message.action.destroy.volume', dataView: true, args: (record, store) => { - return (!['Admin', 'DomainAdmin'].includes(store.userInfo.roletype) && !store.features.allowuserexpungerecovervolumestore) ? [] : ['expunge'] + return (['Admin'].includes(store.userInfo.roletype) || store.features.allowuserexpungerecovervolume) + ? ['expunge'] : [] }, show: (record, store) => { return !['Destroy', 'Destroyed', 'Expunging', 'Expunged', 'Migrating', 'Uploading', 'UploadError', 'Creating', 'Allocated', 'Uploaded'].includes(record.state) && diff --git a/ui/src/views/compute/DestoryVM.vue b/ui/src/views/compute/DestroyVM.vue similarity index 97% rename from ui/src/views/compute/DestoryVM.vue rename to ui/src/views/compute/DestroyVM.vue index 56d2b23ce4f..754bf818241 100644 --- a/ui/src/views/compute/DestoryVM.vue +++ b/ui/src/views/compute/DestroyVM.vue @@ -23,7 +23,7 @@ :form="form" @submit="handleSubmit" layout="vertical"> - + {{ $t('label.expunge') }}