From e4d84378192deafded8d45bcdb2ebe8b0e740b14 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 15 Nov 2021 10:36:20 +0100 Subject: [PATCH] ui: qemu: disk edit: expose read-only flag as advanced option Signed-off-by: Thomas Lamprecht --- www/manager6/qemu/HDEdit.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js index 833655c3..7e5a809a 100644 --- a/www/manager6/qemu/HDEdit.js +++ b/www/manager6/qemu/HDEdit.js @@ -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(