data: {
isSCSI: false,
isVirtIO: false,
+ isSCSISingle: false,
},
},
'field[name=deviceid]': {
change: 'fireIdChange',
},
- 'field[name=iothread]': {
+ 'field[name=scsiController]': {
change: function(f, value) {
- if (!this.getView().insideWizard) {
- return;
- }
- var vmScsiType = value ? 'virtio-scsi-single': 'virtio-scsi-pci';
- this.lookupReference('scsiController').setValue(vmScsiType);
+ let vm = this.getViewModel();
+ vm.set('isSCSISingle', value === 'virtio-scsi-single');
},
},
},
me.scsiController = Ext.create('Ext.form.field.Display', {
fieldLabel: gettext('SCSI Controller'),
reference: 'scsiController',
+ name: 'scsiController',
bind: me.insideWizard ? {
value: '{current.scsihw}',
visible: '{isSCSI}',
reference: 'discard',
name: 'discard',
},
+ {
+ xtype: 'proxmoxcheckbox',
+ name: 'iothread',
+ fieldLabel: 'IO thread',
+ clearOnDisable: true,
+ bind: me.insideWizard || me.isCreate ? {
+ disabled: '{!isVirtIO && !isSCSI}',
+ // Checkbox.setValue handles Arrays in a different way, therefore cast to bool
+ value: '{!!isVirtIO || (isSCSI && isSCSISingle)}',
+ } : {
+ disabled: '{!isVirtIO && !isSCSI}',
+ },
+ },
);
advancedColumn1.push(
disabled: '{isVirtIO}',
},
},
- {
- xtype: 'proxmoxcheckbox',
- name: 'iothread',
- fieldLabel: 'IO thread',
- clearOnDisable: true,
- bind: {
- disabled: '{!isVirtIO && !isSCSI}',
- },
- },
{
xtype: 'proxmoxcheckbox',
name: 'readOnly', // `ro` in the config, we map in get/set values