]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: add 'win11' ostype and set defaults in wizard
authorStefan Reiter <s.reiter@proxmox.com>
Mon, 11 Oct 2021 12:55:20 +0000 (14:55 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Oct 2021 10:41:30 +0000 (12:41 +0200)
Windows 11 requires a TPM and secure boot, so try to auto-enable both.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
www/manager6/Utils.js
www/manager6/qemu/SystemEdit.js

index ee92cd4302e4d8030b817d206e7a7e3dd6254707..274d4db2a42aab78092f0c4d6be929bce705f63b 100644 (file)
@@ -43,6 +43,7 @@ Ext.define('PVE.Utils', {
            { desc: '2.4 Kernel', val: 'l24' },
        ],
        'Microsoft Windows': [
+           { desc: '11/2022', val: 'win11' },
            { desc: '10/2016/2019', val: 'win10' },
            { desc: '8.x/2012/2012r2', val: 'win8' },
            { desc: '7/2008r2', val: 'win7' },
index 8d178f06295d468905b8c98a28d6455af2806938..f3e3fe9c3a22cd677bcb85e8383dc7e3e081788f 100644 (file)
@@ -56,6 +56,20 @@ Ext.define('PVE.qemu.SystemInputPanel', {
            'pveQemuBiosSelector': {
                change: 'biosChange',
            },
+           '#': {
+               afterrender: 'setMachine',
+           },
+       },
+
+       setMachine: function() {
+           let me = this;
+           let vm = this.getViewModel();
+           let ostype = vm.get('current.ostype');
+           if (ostype === 'win11') {
+               me.lookup('machine').setValue('q35');
+               me.lookup('bios').setValue('ovmf');
+               me.lookup('addtpmbox').setValue(true);
+           }
        },
     },
 
@@ -71,6 +85,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
        {
            xtype: 'proxmoxKVComboBox',
            name: 'machine',
+           reference: 'machine',
            value: '__default__',
            fieldLabel: gettext('Machine'),
            comboItems: [
@@ -81,6 +96,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
        {
            xtype: 'pveQemuBiosSelector',
            name: 'bios',
+           reference: 'bios',
            value: '__default__',
            fieldLabel: 'BIOS',
        },