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>
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();