[pve-devel] applied: [PATCH manager 1/2] ui: storage: add enable/hide logic for LIO TPG field

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Aug 2 18:28:16 CEST 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/storage/ZFSEdit.js | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/www/manager6/storage/ZFSEdit.js b/www/manager6/storage/ZFSEdit.js
index a445ef2f..ec818a71 100644
--- a/www/manager6/storage/ZFSEdit.js
+++ b/www/manager6/storage/ZFSEdit.js
@@ -1,6 +1,27 @@
+/*jslint confusion: true*/
 Ext.define('PVE.storage.ZFSInputPanel', {
     extend: 'PVE.panel.StorageBase',
 
+    viewModel: {
+	parent: null,
+	data: {
+	    isLIO: false
+	}
+    },
+
+    controller: {
+	xclass: 'Ext.app.ViewController',
+	control: {
+	    'field[name=iscsiprovider]': {
+		change: 'changeISCSIProvider'
+	    }
+	},
+	changeISCSIProvider: function(f, newVal, oldVal) {
+	    var vm = this.getViewModel();
+	    vm.set('isLIO', newVal === 'LIO');
+	}
+    },
+
     onGetValues: function(values) {
 	var me = this;
 
@@ -93,8 +114,8 @@ Ext.define('PVE.storage.ZFSInputPanel', {
 		xtype: me.isCreate ? 'textfield' : 'displayfield',
 		name: 'lio_tpg',
 		value: '',
-		fieldLabel: gettext('LIO target portal group'),
-		allowBlank: true
+		bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' },
+		fieldLabel: gettext('LIO target portal group')
 	    }
 	];
 
-- 
2.18.0





More information about the pve-devel mailing list