]>
Commit | Line | Data |
---|---|---|
1e4d58ad DM |
1 | Ext.define('PVE.ha.GroupSelector', { |
2 | extend: 'PVE.form.ComboGrid', | |
3 | alias: ['widget.pveHAGroupSelector'], | |
4 | ||
7fc52dff EK |
5 | autoSelect: false, |
6 | valueField: 'group', | |
7 | displayField: 'group', | |
8 | listConfig: { | |
9 | columns: [ | |
10 | { | |
11 | header: gettext('Group'), | |
12 | width: 100, | |
13 | sortable: true, | |
14 | dataIndex: 'group' | |
15 | }, | |
16 | { | |
17 | header: gettext('Nodes'), | |
18 | width: 100, | |
19 | sortable: false, | |
20 | dataIndex: 'nodes' | |
21 | }, | |
22 | { | |
23 | header: gettext('Comment'), | |
24 | flex: 1, | |
91535f2b DC |
25 | dataIndex: 'comment', |
26 | renderer: Ext.String.htmlEncode | |
7fc52dff EK |
27 | } |
28 | ] | |
29 | }, | |
30 | store: { | |
1e4d58ad DM |
31 | model: 'pve-ha-groups', |
32 | sorters: { | |
33 | property: 'group', | |
34 | order: 'DESC' | |
35 | } | |
7fc52dff | 36 | }, |
1e4d58ad | 37 | |
7fc52dff EK |
38 | initComponent: function() { |
39 | var me = this; | |
40 | me.callParent(); | |
41 | me.getStore().load(); | |
1e4d58ad DM |
42 | } |
43 | ||
44 | }, function() { | |
45 | ||
46 | Ext.define('pve-ha-groups', { | |
47 | extend: 'Ext.data.Model', | |
48 | fields: [ | |
49 | 'group', 'type', 'restricted', 'digest', 'nofailback', | |
50 | 'nodes', 'comment' | |
51 | ], | |
52 | proxy: { | |
53 | type: 'pve', | |
54 | url: "/api2/json/cluster/ha/groups" | |
55 | }, | |
56 | idProperty: 'group' | |
57 | }); | |
58 | }); |