mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-10-04 05:35:37 +00:00
ui: qemu: unify enabled state of pci, usb and rng
all 3 additions fail in the backend, if a user does not have VM.Config.HWType on the VM. unify their display to cause less confusion, to the most recently added version for the rng. drop the now unused noHWPerm (eslint reminded me about that). found while reviewing: https://lore.proxmox.com/all/20250408195959.0b1f3aaf@rosa.proxmox.com/T/#t Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com> Link: https://lore.proxmox.com/20250408181640.2332561-1-s.ivanov@proxmox.com
This commit is contained in:
parent
c7b75cc57f
commit
5641693298
@ -599,7 +599,6 @@ Ext.define('PVE.qemu.HardwareView', {
|
||||
});
|
||||
|
||||
// heuristic only for disabling some stuff, the backend has the final word.
|
||||
const noHWPerm = !caps.nodes['Sys.Console'] && !caps.mapping['Mapping.Use'];
|
||||
const noVMConfigHWTypePerm = !caps.vms['VM.Config.HWType'];
|
||||
const noVMConfigNetPerm = !caps.vms['VM.Config.Network'];
|
||||
const noVMConfigDiskPerm = !caps.vms['VM.Config.Disk'];
|
||||
@ -607,8 +606,8 @@ Ext.define('PVE.qemu.HardwareView', {
|
||||
const noVMConfigCloudinitPerm = !caps.vms['VM.Config.Cloudinit'];
|
||||
const noVMConfigOptionsPerm = !caps.vms['VM.Config.Options'];
|
||||
|
||||
me.down('#addUsb').setDisabled(noHWPerm || isAtUsbLimit());
|
||||
me.down('#addPci').setDisabled(noHWPerm || isAtLimit('hostpci'));
|
||||
me.down('#addUsb').setDisabled(noVMConfigHWTypePerm || isAtUsbLimit());
|
||||
me.down('#addPci').setDisabled(noVMConfigHWTypePerm || isAtLimit('hostpci'));
|
||||
me.down('#addAudio').setDisabled(noVMConfigHWTypePerm || isAtLimit('audio'));
|
||||
me.down('#addSerial').setDisabled(noVMConfigHWTypePerm || isAtLimit('serial'));
|
||||
me.down('#addNet').setDisabled(noVMConfigNetPerm || isAtLimit('net'));
|
||||
|
Loading…
Reference in New Issue
Block a user