]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: vm/efi: always allow to add EFI disk even if OVMF is not yet set
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Oct 2019 07:30:03 +0000 (09:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Oct 2019 07:30:06 +0000 (09:30 +0200)
As this is annoying else, especially if the change from default to
ovmf BIOS is already a pending change..

A simple hint is enough, we do not do anything with the EFI disk if
OVMF is not set to be used anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/qemu/HDEfi.js
www/manager6/qemu/HardwareView.js

index 3820078d41dc21c36a00ad2c412bd0ce74e32a5e..cec27538ce047adc0ea4ba7b20db4fc3a4756753 100644 (file)
@@ -37,15 +37,22 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
 
        me.drive = {};
 
-       me.items= [];
-
-       me.items.push({
-           xtype: 'pveDiskStorageSelector',
-           name: 'efidisk0',
-           storageContent: 'images',
-           nodename: me.nodename,
-           hideSize: true
-       });
+       me.items= [
+           {
+               xtype: 'pveDiskStorageSelector',
+               name: 'efidisk0',
+               storageContent: 'images',
+               nodename: me.nodename,
+               hideSize: true
+           },
+           {
+               xtype: 'label',
+               text: gettext("Warning: The VM currently does not uses 'OVMF (UEFI)' as BIOS."),
+               userCls: 'pve-hint',
+               hidden: me.usesEFI,
+           },
+       ];
+
        me.callParent();
     }
 });
@@ -56,6 +63,7 @@ Ext.define('PVE.qemu.EFIDiskEdit', {
     isAdd: true,
     subject: gettext('EFI Disk'),
 
+    width: 450,
     initComponent : function() {
        var me = this;
 
@@ -69,7 +77,8 @@ Ext.define('PVE.qemu.EFIDiskEdit', {
            onlineHelp: 'qm_bios_and_uefi',
            confid: me.confid,
            nodename: nodename,
-           isCreate: true
+           usesEFI: me.usesEFI,
+           isCreate: true,
        }];
 
        me.callParent();
index 606c66e55eb234a15f7463fb2b9e1e5e6dfd2b27..cd65d14d84da7f1235d1f8d7a61389c58e20718e 100644 (file)
@@ -530,20 +530,16 @@ Ext.define('PVE.qemu.HardwareView', {
            iconCls: 'fa fa-fw fa-hdd-o black',
            disabled: !caps.vms['VM.Config.Disk'],
            handler: function() {
+               let bios = me.rstore.getData().map.bios;
+               let usesEFI = bios && (bios.data.value === 'ovmf' || bios.data.pending === 'ovmf');
 
-               var rstoredata = me.rstore.getData().map;
-               // check if ovmf is configured
-               if (rstoredata.bios && rstoredata.bios.data.value === 'ovmf') {
-                   var win = Ext.create('PVE.qemu.EFIDiskEdit', {
-                       url: '/api2/extjs/' + baseurl,
-                       pveSelNode: me.pveSelNode
-                   });
-                   win.on('destroy', reload);
-                   win.show();
-               } else {
-                   Ext.Msg.alert('Error',gettext('Please select OVMF(UEFI) as BIOS first.'));
-               }
-
+               var win = Ext.create('PVE.qemu.EFIDiskEdit', {
+                   url: '/api2/extjs/' + baseurl,
+                   pveSelNode: me.pveSelNode,
+                   usesEFI: usesEFI,
+               });
+               win.on('destroy', reload);
+               win.show();
            }
        });