]>
Commit | Line | Data |
---|---|---|
7e3fe38a | 1 | Ext.define('pve-groups', { |
3b1cb257 | 2 | extend: 'Ext.data.Model', |
8058410f | 3 | fields: ['groupid', 'comment', 'users'], |
3b1cb257 DC |
4 | proxy: { |
5 | type: 'proxmox', | |
f6710aac | 6 | url: "/api2/json/access/groups", |
3b1cb257 | 7 | }, |
f6710aac | 8 | idProperty: 'groupid', |
7e3fe38a RJ |
9 | }); |
10 | ||
26322062 | 11 | Ext.define('PVE.form.GroupSelector', { |
0fc95a12 | 12 | extend: 'Proxmox.form.ComboGrid', |
7e3fe38a | 13 | xtype: 'pveGroupSelector', |
26322062 DM |
14 | |
15 | allowBlank: false, | |
a13842bf EK |
16 | autoSelect: false, |
17 | valueField: 'groupid', | |
18 | displayField: 'groupid', | |
19 | listConfig: { | |
20 | columns: [ | |
21 | { | |
22 | header: gettext('Group'), | |
23 | sortable: true, | |
24 | dataIndex: 'groupid', | |
f6710aac | 25 | flex: 1, |
a13842bf EK |
26 | }, |
27 | { | |
28 | header: gettext('Comment'), | |
29 | sortable: false, | |
30 | dataIndex: 'comment', | |
91535f2b | 31 | renderer: Ext.String.htmlEncode, |
f6710aac | 32 | flex: 1, |
88ac19dd FG |
33 | }, |
34 | { | |
35 | header: gettext('Users'), | |
36 | sortable: false, | |
37 | dataIndex: 'users', | |
1011b569 | 38 | renderer: Ext.String.htmlEncode, |
f6710aac TL |
39 | flex: 1, |
40 | }, | |
41 | ], | |
a13842bf | 42 | }, |
26322062 DM |
43 | |
44 | initComponent: function() { | |
45 | var me = this; | |
46 | ||
47 | var store = new Ext.data.Store({ | |
3253e118 DC |
48 | model: 'pve-groups', |
49 | sorters: [{ | |
f6710aac TL |
50 | property: 'groupid', |
51 | }], | |
26322062 DM |
52 | }); |
53 | ||
54 | Ext.apply(me, { | |
f6710aac | 55 | store: store, |
26322062 DM |
56 | }); |
57 | ||
7e3fe38a | 58 | me.callParent(); |
26322062 DM |
59 | |
60 | store.load(); | |
f6710aac | 61 | }, |
26322062 | 62 | }); |