]> git.proxmox.com Git - pve-manager.git/commitdiff
copy form/SecurityGroupSelector.js from manager to manager5
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jul 2015 09:29:11 +0000 (11:29 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 3 Jul 2015 09:29:11 +0000 (11:29 +0200)
www/manager5/form/SecurityGroupSelector.js [new file with mode: 0644]

diff --git a/www/manager5/form/SecurityGroupSelector.js b/www/manager5/form/SecurityGroupSelector.js
new file mode 100644 (file)
index 0000000..37e6bac
--- /dev/null
@@ -0,0 +1,46 @@
+Ext.define('PVE.form.SecurityGroupsSelector', {
+    extend: 'PVE.form.ComboGrid',
+    alias: ['widget.pveSecurityGroupsSelector'],
+
+    initComponent: function() {
+       var me = this;
+
+       var store = Ext.create('Ext.data.Store', {
+           autoLoad: true,
+           fields: [ 'group', 'comment' ],
+           idProperty: 'group',
+           proxy: {
+               type: 'pve',
+               url: "/api2/json/cluster/firewall/groups"
+           },
+           sorters: {
+               property: 'group',
+               order: 'DESC'
+           }
+       });
+
+       Ext.apply(me, {
+           store: store,
+           valueField: 'group',
+           displayField: 'group',
+            listConfig: {
+               columns: [
+                   {
+                       header: gettext('Security Group'),
+                       dataIndex: 'group',
+                       hideable: false,
+                       width: 100
+                   },
+                   {
+                       header: gettext('Comment'),  
+                       dataIndex: 'comment', 
+                       flex: 1
+                   }
+               ]
+           }
+       });
+
+        me.callParent();
+    }
+});
+