ui: qemu: disk edit: expose read-only flag as advanced option

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-11-15 10:36:20 +01:00
parent 3f543d7ff7
commit e4d8437819

View File

@ -90,6 +90,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
PVE.Utils.propertyStringSet(me.drive, values.discard, 'discard', 'on');
PVE.Utils.propertyStringSet(me.drive, values.ssd, 'ssd', 'on');
PVE.Utils.propertyStringSet(me.drive, values.iothread, 'iothread', 'on');
PVE.Utils.propertyStringSet(me.drive, values.readOnly, 'ro', 'on');
PVE.Utils.propertyStringSet(me.drive, values.cache, 'cache');
var names = ['mbps_rd', 'mbps_wr', 'iops_rd', 'iops_wr'];
@ -151,6 +152,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
values.discard = drive.discard === 'on';
values.ssd = PVE.Parser.parseBoolean(drive.ssd);
values.iothread = PVE.Parser.parseBoolean(drive.iothread);
values.readOnly = PVE.Parser.parseBoolean(drive.ro);
values.mbps_rd = drive.mbps_rd;
values.mbps_wr = drive.mbps_wr;
@ -274,6 +276,17 @@ Ext.define('PVE.qemu.HDInputPanel', {
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}',
},
},
);
advancedColumn2.push(