[pve-devel] [PATCH pve-manager 2/2] fix #1499 Implement a combobox for Permissions paths

René Jochum r.jochum at proxmox.com
Fri May 4 16:06:47 CEST 2018


Signed-off-by: René Jochum <r.jochum at proxmox.com>
---
 www/manager6/Makefile                 |  1 +
 www/manager6/dc/ACLView.js            |  2 +-
 www/manager6/form/PermPathSelector.js | 24 ++++++++++++++++++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 www/manager6/form/PermPathSelector.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 60e8103e..04bb4f58 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -58,6 +58,7 @@ JSSRC= 				                 	\
 	form/USBSelector.js				\
 	form/CalendarEvent.js				\
 	form/CephPoolSelector.js				\
+	form/PermPathSelector.js				\
 	dc/Tasks.js					\
 	dc/Log.js					\
 	panel/StatusPanel.js				\
diff --git a/www/manager6/dc/ACLView.js b/www/manager6/dc/ACLView.js
index e12c83f2..1322f952 100644
--- a/www/manager6/dc/ACLView.js
+++ b/www/manager6/dc/ACLView.js
@@ -12,7 +12,7 @@ Ext.define('PVE.dc.ACLAdd', {
 
 	var items = [
 	    {
-		xtype: me.path ? 'hiddenfield' : 'textfield',
+		xtype: me.path ? 'hiddenfield' : 'pvePermPathSelector',
 		name: 'path',
 		value: me.path,
 		allowBlank: false,
diff --git a/www/manager6/form/PermPathSelector.js b/www/manager6/form/PermPathSelector.js
new file mode 100644
index 00000000..d461c6c3
--- /dev/null
+++ b/www/manager6/form/PermPathSelector.js
@@ -0,0 +1,24 @@
+Ext.define('pve-permpath', {
+    extend: 'Ext.data.Store',
+    alias: 'store.permpathstore',
+    fields: [ 'value' ],
+    data: [
+	{'value':  '/access'},
+	{'value': '/nodes'},
+	{'value': '/pool'},
+	{'value': '/storage'},
+	{'value': '/vms'}
+    ]
+});
+
+Ext.define('PVE.form.PermPathSelector', {
+    extend: 'Ext.form.field.ComboBox',
+    xtype: 'pvePermPathSelector',
+
+    valueField: 'value',
+    displayField: 'value',
+    typeAhead: true,
+    store: {
+	    type: 'permpathstore'
+    }
+});
-- 
2.11.0




More information about the pve-devel mailing list