[pve-devel] [PATCH 2/2] Change isci provider field from text input to drop-down list

mir at datanom.net mir at datanom.net
Thu Oct 24 08:47:50 CEST 2013


From: Michael Rasmussen <mir at datanom.net>

Signed-off-by: Michael Rasmussen <mir at datanom.net>
---
 www/manager/storage/ZFSEdit.js | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/www/manager/storage/ZFSEdit.js b/www/manager/storage/ZFSEdit.js
index 5dd5329..dc6b906 100644
--- a/www/manager/storage/ZFSEdit.js
+++ b/www/manager/storage/ZFSEdit.js
@@ -64,6 +64,15 @@ Ext.define('PVE.storage.ZFSInputPanel', {
         }
     ];
 
+    var providers = Ext.create('Ext.data.Store', {
+        fields: ['provider', 'name'],
+        data: [
+            {'provider':'comstar', 'name':'Comstar (Solaris)'},
+            {'provider':'istgt', 'name':'Istgt (BSD)'},
+            {'provider':'iet', 'name':'Iet (Linux)'}
+        ]
+    });
+
     me.column2 = [
         {
         xtype: 'pvecheckbox',
@@ -73,12 +82,17 @@ Ext.define('PVE.storage.ZFSInputPanel', {
         fieldLabel: gettext('Enable')
         },
         {
-        xtype: me.create ? 'textfield' : 'displayfield',
-        name: 'iscsiprovider',
-        height: 22, // hack: set same height as text fields
-        value: 'Comstar',
+        xtype: me.create ? 'combobox' : 'displayfield',
         fieldLabel: gettext('iSCSI Provider'),
-        allowBlank: false
+        name: 'iscsiprovider',
+        queryMode: 'local',
+        width:120,
+        listWidth: 120,
+        editable: false,
+        value: providers.first().get('provider'),
+        store: providers,
+        displayField: 'name',
+        valueField: 'provider'
         }
     ];
 
-- 
1.8.4.rc3




More information about the pve-devel mailing list