[pve-devel] [PATCH manager v3 5/8] Add a field to show which SCSI controller type we are currently using

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Sep 27 11:27:31 CEST 2017


On 09/26/2017 02:17 PM, Emmanuel Kasper wrote:
> ---
>   www/manager6/qemu/HDEdit.js | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
> index 8a415d8b..075ad667 100644
> --- a/www/manager6/qemu/HDEdit.js
> +++ b/www/manager6/qemu/HDEdit.js
> @@ -24,11 +24,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
>   		this.lookup('iothread').setValue(false);
>   	    }
>   
> -	    var allowDiscard = value.match(/^scsi/);
> -	    this.lookup('discard').setDisabled(!allowDiscard);
> -	    if (!allowDiscard) {
> +	    var scsi = value.match(/^scsi/);
> +	    this.lookup('discard').setDisabled(!scsi);
> +	    if (!scsi) {
>   		this.lookup('discard').setValue(false);
>   	    }
> +	    this.lookup('scsiType').setVisible(scsi);
>   	},
>   
>   	control: {
> @@ -141,6 +142,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
>   
>   	if (me.bussel) {
>   	    me.bussel.setVMConfig(vmconfig);
> +	    me.scsiType.setValue(vmconfig.scsihw);
>   	}
>   	if (me.unusedDisks) {
>   	    var disklist = [];
> @@ -195,6 +197,13 @@ Ext.define('PVE.qemu.HDInputPanel', {
>   		vmconfig: me.insideWizard ? {ide2: 'cdrom'} : {}
>   	    });
>   	    me.column1.push(me.bussel);
> +	    me.scsiType = Ext.create('Ext.form.field.Display', {> +		fieldLabel: gettext('Type'),

Type is to general and not really true here (Type of what?).
'SCSI Controller' would match the scsihw edit window better
and make it clearer why it disappears when something other
than SCSI is selected, what do you think?


> +		reference: 'scsiType',
> +		renderer: PVE.Utils.render_scsihw,
> +		hidden: true
> +	    });
> +	    me.column1.push(me.scsiType);
>   	}
>   
>   	if (me.unused) {
> 





More information about the pve-devel mailing list