]> git.proxmox.com Git - pve-manager.git/commitdiff
copy ha/GroupSelector.js from manager to manager6
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 15 Feb 2016 11:35:14 +0000 (12:35 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 15 Feb 2016 11:35:14 +0000 (12:35 +0100)
www/manager6/ha/GroupSelector.js [new file with mode: 0644]

diff --git a/www/manager6/ha/GroupSelector.js b/www/manager6/ha/GroupSelector.js
new file mode 100644 (file)
index 0000000..01e97b4
--- /dev/null
@@ -0,0 +1,63 @@
+Ext.define('PVE.ha.GroupSelector', {
+    extend: 'PVE.form.ComboGrid',
+    alias: ['widget.pveHAGroupSelector'],
+
+    initComponent: function() {
+       var me = this;
+
+       var store = new Ext.data.Store({
+           model: 'pve-ha-groups',
+           sorters: { 
+               property: 'group', 
+               order: 'DESC' 
+           }
+       });
+
+       Ext.apply(me, {
+           store: store,
+           autoSelect: false,
+           valueField: 'group',
+           displayField: 'group',
+            listConfig: {
+               columns: [
+                   {
+                       header: gettext('Group'),
+                       width: 100,
+                       sortable: true,
+                       dataIndex: 'group'
+                   },
+                   {
+                       header: gettext('Nodes'),
+                       width: 100,
+                       sortable: false,
+                       dataIndex: 'nodes'
+                   },
+                   {
+                       header: gettext('Comment'),
+                       flex: 1,
+                       dataIndex: 'comment'
+                   }
+               ]
+           }
+       });
+
+        me.callParent();
+
+       store.load();
+    }
+
+}, function() {
+
+    Ext.define('pve-ha-groups', {
+       extend: 'Ext.data.Model',
+       fields: [ 
+           'group', 'type', 'restricted', 'digest', 'nofailback',
+           'nodes', 'comment'
+       ],
+       proxy: {
+            type: 'pve',
+           url: "/api2/json/cluster/ha/groups"
+       },
+       idProperty: 'group'
+    });
+});