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

Emmanuel Kasper e.kasper at proxmox.com
Mon Oct 2 10:37:34 CEST 2017


---
 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'),
+		reference: 'scsiType',
+		renderer: PVE.Utils.render_scsihw,
+		hidden: true
+	    });
+	    me.column1.push(me.scsiType);
 	}
 
 	if (me.unused) {
-- 
2.11.0




More information about the pve-devel mailing list