]>
git.proxmox.com Git - pmg-gui.git/blob - js/LDAPGroupEditor.js
e05980a84152be0375a7bf285825a8e53da4ee17
1 Ext
.define('PMG.LDAPGroupInputPanel', {
2 extend
: 'Proxmox.panel.InputPanel',
3 alias
: 'widget.pmgLDAPGroupInputPanel',
5 onGetValues: function(values
) {
6 if (values
.mode
=== 'profile-any') {
8 } else if (values
.mode
=== 'profile-none') {
15 setValues: function(values
) {
18 if (values
.profile
!== undefined) {
19 if (values
.mode
=== 'any') {
20 values
.mode
= 'profile-any';
21 } else if (values
.mode
=== 'none') {
22 values
.mode
= 'profile-none';
26 if (values
.profile
!== undefined) {
27 var groupField
= this.lookupReference('groupField');
28 groupField
.setProfile(values
.profile
);
31 me
.callParent([values
]);
36 xclass
: 'Ext.app.ViewController',
38 changeMode: function(f
, value
) {
39 var groupField
= this.lookupReference('groupField');
40 groupField
.setDisabled(value
!== 'group');
41 groupField
.setVisible(value
=== 'group');
42 var profileField
= this.lookupReference('profileField');
43 var enabled
= ((value
!= 'any') && (value
!= 'none'));
44 profileField
.setDisabled(!enabled
);
45 profileField
.setVisible(enabled
);
48 changeProfile: function(f
, value
) {
49 var groupField
= this.lookupReference('groupField');
50 groupField
.setProfile(value
);
57 'field[name=profile]': {
58 change
: 'changeProfile'
65 xtype
: 'proxmoxKVComboBox',
69 [ 'group', gettext('Group member') ],
70 [ 'profile-any', gettext('Existing LDAP address')],
71 [ 'any', gettext('Existing LDAP address') +
73 [ 'profile-none', gettext('Unknown LDAP address')],
74 [ 'none', gettext('Unknown LDAP address') +
77 fieldLabel
: gettext("Match")
80 xtype
: 'pmgLDAPProfileSelector',
82 reference
: 'profileField',
83 fieldLabel
: gettext("Profile")
86 xtype
: 'pmgLDAPGroupSelector',
88 reference
: 'groupField',
89 fieldLabel
: gettext("Group")
94 Ext
.define('PMG.LDAPGroupEditor', {
95 extend
: 'Proxmox.window.Edit',
96 alias
: 'widget.pmgLDAPGroupEditor',
100 items
: { xtype
: 'pmgLDAPGroupInputPanel' }