diff --git a/ui/src/components/view/ActionButton.vue b/ui/src/components/view/ActionButton.vue index bf9f63b0fdd..5202cc6001d 100644 --- a/ui/src/components/view/ActionButton.vue +++ b/ui/src/components/view/ActionButton.vue @@ -39,7 +39,8 @@ action.showBadge && ( (!dataView && ((action.listView && ('show' in action ? action.show(resource, $store.getters) : true)) || (action.groupAction && selectedRowKeys.length > 0 && ('groupShow' in action ? action.show(resource, $store.getters) : true)))) || (dataView && action.dataView && ('show' in action ? action.show(resource, $store.getters) : true)) - )" > + )" + :disabled="'disabled' in action ? action.disabled(resource, $store.getters) : false" > 0 && ('groupShow' in action ? action.show(resource, $store.getters) : true)))) || (dataView && action.dataView && ('show' in action ? action.show(resource, $store.getters) : true)) )" + :disabled="'disabled' in action ? action.disabled(resource, $store.getters) : false" :type="action.icon === 'delete' ? 'danger' : (action.icon === 'plus' ? 'primary' : 'default')" :shape="!dataView && ['plus', 'user-add'].includes(action.icon) ? 'round' : 'circle'" style="margin-left: 5px" diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 4345b0118bc..db6ab88d736 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -286,7 +286,8 @@ export default { label: 'label.scale.vm', docHelp: 'adminguide/virtual_machines.html#how-to-dynamically-scale-cpu-and-ram', dataView: true, - show: (record) => { return ['Stopped'].includes(record.state) || (['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC' && record.isdynamicallyscalable) }, + show: (record) => { return ['Stopped'].includes(record.state) || (['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC') }, + disabled: (record) => { return !record.isdynamicallyscalable }, popup: true, component: () => import('@/views/compute/ScaleVM.vue') },