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',
},
- );
-
- advancedColumn1.push(
{
xtype: 'proxmoxcheckbox',
- fieldLabel: gettext('SSD emulation'),
- name: 'ssd',
+ name: 'iothread',
+ fieldLabel: 'IO thread',
clearOnDisable: true,
bind: {
- disabled: '{isVirtIO}',
+ disabled: '{!isVirtIO && !isSCSI}',
+ // Checkbox.setValue handles Arrays in a different way, therefore cast to bool
+ value: '{!!isVirtIO || (isSCSI && isSCSISingle)}',
},
},
+ );
+
+ advancedColumn1.push(
{
xtype: 'proxmoxcheckbox',
- name: 'iothread',
- fieldLabel: 'IO thread',
+ fieldLabel: gettext('SSD emulation'),
+ name: 'ssd',
clearOnDisable: true,
bind: {
- disabled: '{!isVirtIO && !isSCSI}',
+ disabled: '{isVirtIO}',
},
},
{