From: Thomas Lamprecht Date: Thu, 22 Nov 2018 07:40:15 +0000 (+0100) Subject: ui: qemu/HW: menu setDisable mustn't ignore caps X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3097170daddbdcd0e464d48b3b8698544b691942;p=pve-manager.git ui: qemu/HW: menu setDisable mustn't ignore caps We passed a 'disable' config to those menu items on creation, but promptly ignored that after the first set_button_status call, which only checked if it's possible to add another device, but not if our capabilities heuristic is OK. Signed-off-by: Thomas Lamprecht --- diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js index 8313c2a4..fdfe80f1 100644 --- a/www/manager6/qemu/HardwareView.js +++ b/www/manager6/qemu/HardwareView.js @@ -511,8 +511,12 @@ Ext.define('PVE.qemu.HardwareView', { hasCloudInit = true; } }); - me.down('#addusb').setDisabled((count >= 5)); - me.down('#addci').setDisabled(hasCloudInit); + + // heuristic only for disabling some stuff, the backend has the final word. + var noSysConsolePerm = !caps.nodes['Sys.Console']; + + me.down('#addusb').setDisabled(noSysConsolePerm || (count >= 5)); + me.down('#addci').setDisabled(noSysConsolePerm || hasCloudInit); if (!rec) { remove_btn.disable();