]> git.proxmox.com Git - pmg-gui.git/blob - js/LDAPGroupSelector.js
quarantine list: cope with undefined mail value
[pmg-gui.git] / js / LDAPGroupSelector.js
1 Ext.define('PMG.LDAPGroupSelector', {
2 extend: 'Ext.form.ComboBox',
3 alias: 'widget.pmgLDAPGroupSelector',
4
5 profile: undefined,
6
7 queryMode: 'local',
8
9 store: {
10 fields: ['dn'],
11 filterOnLoad: true,
12 sorters: [
13 {
14 property: 'dn',
15 direction: 'ASC',
16 },
17 ],
18 },
19
20 valueField: 'dn',
21 displayField: 'dn',
22
23 allowBlank: false,
24
25 setProfile: function(profile, force) {
26 var me = this;
27
28 if (!force && (profile === undefined || profile === null || me.profile === profile)) {
29 return;
30 }
31
32 me.profile = profile;
33
34 me.setValue('');
35
36 me.store.setProxy({
37 type: 'proxmox',
38 url: '/api2/json/config/ldap/' + me.profile + '/groups',
39 });
40
41 me.store.load();
42 },
43
44 initComponent: function() {
45 var me = this;
46
47 me.callParent();
48
49 if (me.profile !== undefined) {
50 me.setProfile(me.profile, true);
51 }
52 },
53 });
54