[pve-devel] [PATCH manager 2/7] gui: add qemu/SystemEdit

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Mar 27 17:10:19 CET 2019


On 3/27/19 2:13 PM, Dominik Csapak wrote:
> contains the inputpanel for the coming system tab in the vm creation
> wizard, where the user can configure the vm system hardware like
> the scsi controller, display, etc.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> {snip}
> +
> +    advancedColumn1: [
> +	{
> +	    xtype: 'pveQemuBiosSelector',
> +	    name: 'bios',
> +	    value: '__default__',
> +	    fieldLabel: 'BIOS'
allowing one to add a efi disk immediately here would be nice, as no hint is visible
here and else it's a bit confusing for users if this does not works on create (and
their initial guest setup is unbootable after installation).

I tried to whip something up quickly, looks are OK, but it isn't complete yet.
the pveEFIDiskInputPanel sub-fields get still added to the wizard-submited vmconfig
and some disable/enable/vallidity issues are not 100% ironed out, but to give one a
idea about what I mean:

----8<----
diff --git a/www/manager6/qemu/CreateWizard.js b/www/manager6/qemu/CreateWizard.js
index 79e31504..9cefb10e 100644
--- a/www/manager6/qemu/CreateWizard.js
+++ b/www/manager6/qemu/CreateWizard.js
@@ -8,6 +8,7 @@ Ext.define('PVE.qemu.CreateWizard', {
 	data: {
 	    nodename: '',
 	    current: {
+		efi: false,
 		scsihw: ''
 	    }
 	}
diff --git a/www/manager6/qemu/HDEfi.js b/www/manager6/qemu/HDEfi.js
index 3820078d..1c5d6cfb 100644
--- a/www/manager6/qemu/HDEfi.js
+++ b/www/manager6/qemu/HDEfi.js
@@ -32,6 +32,13 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
 	me.down('#hdimage').setStorage(undefined, nodename);
     },
 
+    setDisabled: function(disabled) {
+	var me = this;
+	me.down('#hdstorage').setDisabled(disabled);
+	me.down('#hdimage').setDisabled(disabled);
+	me.callParent(arguments);
+    },
+
     initComponent : function() {
 	var me = this;
 
@@ -42,6 +49,7 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
 	me.items.push({
 	    xtype: 'pveDiskStorageSelector',
 	    name: 'efidisk0',
+	    autoSelect: me.insideWizard,
 	    storageContent: 'images',
 	    nodename: me.nodename,
 	    hideSize: true
diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js
index 89e348bb..121943cf 100644
--- a/www/manager6/qemu/SystemEdit.js
+++ b/www/manager6/qemu/SystemEdit.js
@@ -18,14 +18,23 @@ Ext.define('PVE.qemu.SystemInputPanel', {
 
 	scsihwChange: function(field, value) {
 	    var me = this;
-	    if (me.getView().inisdeWizard) {
+	    if (me.getView().insideWizard) {
 		me.getViewModel().set('current.scsihw', value);
 	    }
 	},
+	biosChange: function(field, value) {
+	    var me = this;
+	    if (me.getView().insideWizard) {
+		me.getViewModel().set('current.efi', value === 'ovmf');
+	    }
+	},
 
 	control: {
 	    'pveScsiHwSelector': {
 		change: 'scsihwChange'
+	    },
+	    'pveQemuBiosSelector': {
+		change: 'biosChange'
 	    }
 	}
     },
@@ -67,6 +76,28 @@ Ext.define('PVE.qemu.SystemInputPanel', {
 	    name: 'bios',
 	    value: '__default__',
 	    fieldLabel: 'BIOS'
+	},
+	{
+	    xtype: 'checkbox',
+	    submitValue: false,
+	    value: true,
+	    name: 'addEfiDisk',
+	    reference: 'addEfiDisk',
+	    bind: {
+		hidden: '{!current.efi}'
+	    },
+	    fieldLabel: gettext('EFI Disk')
+	},
+	{
+	    xtype: 'pveEFIDiskInputPanel',
+	    submitValue: false,
+	    insideWizard: true,
+	    bind: {
+		hidden: '{!current.efi}',
+		nodename: '{nodename}',
+		disabled: '{!addEfiDisk.checked}'
+	    },
+	    fieldLabel: 'EFI Disk'
 	}
     ],
 
--



More information about the pve-devel mailing list