mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 13:16:05 +08:00
fix: vGPU and USB enable/disable actions needs to be hidden for read only users (#877)
* fix: vGPU / USB enable/disable actions needs to be hidden for read only users Signed-off-by: Andy Lee <andy.lee@suse.com> * style: add scoped styles for group actions in DeviceList component Signed-off-by: Andy Lee <andy.lee@suse.com> * style: remove width property from group actions in DeviceList components Signed-off-by: Andy Lee <andy.lee@suse.com> * fix: update logging type in init function and improve SideNav visibility handling Signed-off-by: Andy Lee <andy.lee@suse.com> * fix: ensure canManageGroup only returns true for non-empty rows with updatable permissions Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
@@ -23,17 +23,17 @@ export default class HciVmTemplateVersion extends HarvesterResource {
|
||||
});
|
||||
|
||||
const schema = this.$getters['schemaFor'](HCI.VM);
|
||||
let canCreateVM = true;
|
||||
let canCreateVM = false;
|
||||
|
||||
if ( schema && !schema?.collectionMethods.find((x) => ['post'].includes(x.toLowerCase())) ) {
|
||||
canCreateVM = false;
|
||||
if (schema?.collectionMethods.find((x) => ['post'].includes(x.toLowerCase())) ) {
|
||||
canCreateVM = true;
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
action: 'launchFromTemplate',
|
||||
icon: 'icon icon-spinner',
|
||||
disabled: !canCreateVM || !this.isReady,
|
||||
enabled: canCreateVM && this.isReady,
|
||||
label: this.t('harvester.action.launchFormTemplate'),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user