]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: qemu/HW: menu setDisable mustn't ignore caps
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Nov 2018 07:40:15 +0000 (08:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Nov 2018 07:40:15 +0000 (08:40 +0100)
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 <t.lamprecht@proxmox.com>
www/manager6/qemu/HardwareView.js

index 8313c2a42658ff4dc02a82ee5a02634f9a09d3d0..fdfe80f1fda2c3e3295efd8fd46b53f39b9f1277 100644 (file)
@@ -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();