]>
Commit | Line | Data |
---|---|---|
9a3c1cb4 DC |
1 | Ext.define('pmx-roles', { |
2 | extend: 'Ext.data.Model', | |
3 | fields: ['roleid', 'privs'], | |
4 | proxy: { | |
5 | type: 'proxmox', | |
6 | url: "/api2/json/access/roles", | |
7 | }, | |
8 | idProperty: 'roleid', | |
9 | }); | |
10 | ||
11 | Ext.define('Proxmox.form.RoleSelector', { | |
12 | extend: 'Proxmox.form.ComboGrid', | |
13 | alias: 'widget.pmxRoleSelector', | |
14 | ||
15 | allowBlank: false, | |
16 | autoSelect: false, | |
17 | valueField: 'roleid', | |
18 | displayField: 'roleid', | |
19 | ||
20 | listConfig: { | |
49275c67 | 21 | width: 500, |
9a3c1cb4 DC |
22 | columns: [ |
23 | { | |
24 | header: gettext('Role'), | |
25 | sortable: true, | |
26 | dataIndex: 'roleid', | |
49275c67 | 27 | flex: 2, |
9a3c1cb4 DC |
28 | }, |
29 | { | |
30 | header: gettext('Privileges'), | |
31 | dataIndex: 'privs', | |
49275c67 TL |
32 | cellWrap: true, |
33 | // join manually here, as ExtJS joins without whitespace which breaks cellWrap | |
34 | renderer: v => v.join(', '), | |
35 | flex: 5, | |
9a3c1cb4 DC |
36 | }, |
37 | ], | |
38 | }, | |
39 | ||
40 | store: { | |
41 | autoLoad: true, | |
42 | model: 'pmx-roles', | |
43 | sorters: 'roleid', | |
44 | }, | |
45 | }); |