]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: qemu: disk edit: expose read-only flag as advanced option
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 15 Nov 2021 09:36:20 +0000 (10:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 15 Nov 2021 10:17:11 +0000 (11:17 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/qemu/HDEdit.js

index 833655c37150c561f09989157b7c1de1097e1131..7e5a809ab03ae0671038ee8226e46a28e7d4b579 100644 (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(