viewModel: {
data: {
- isScsi: false,
+ 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');
},
},
},
initComponent: function() {
var me = this;
- var labelWidth = 140;
-
me.drive = {};
let column1 = [];
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(
{
xtype: 'proxmoxcheckbox',
fieldLabel: gettext('SSD emulation'),
- labelWidth: labelWidth,
name: 'ssd',
clearOnDisable: true,
bind: {
disabled: '{isVirtIO}',
},
},
- {
- xtype: 'proxmoxcheckbox',
- name: 'iothread',
- fieldLabel: 'IO thread',
- labelWidth: labelWidth,
- clearOnDisable: true,
- bind: {
- disabled: '{!isVirtIO && !isSCSI}',
- },
- },
{
xtype: 'proxmoxcheckbox',
name: 'readOnly', // `ro` in the config, we map in get/set values
defaultValue: 0,
fieldLabel: gettext('Read-only'),
- labelWidth: labelWidth,
clearOnDisable: true,
bind: {
disabled: '{!isVirtIO && !isSCSI}',
tag: 'div',
'data-qtip': gettext('Include volume in backup job'),
},
- labelWidth: labelWidth,
name: 'backup',
bind: {
value: '{isIncludedInBackup}',
{
xtype: 'proxmoxcheckbox',
fieldLabel: gettext('Skip replication'),
- labelWidth: labelWidth,
name: 'noreplicate',
},
{
fieldLabel: gettext('Async IO'),
allowBlank: false,
value: '__default__',
- labelWidth: labelWidth,
comboItems: [
['__default__', Proxmox.Utils.defaultText + ' (io_uring)'],
['io_uring', 'io_uring'],
},
);
+ let labelWidth = 140;
+
let bwColumn1 = [
{
xtype: 'numberfield',