]>
git.proxmox.com Git - pmg-gui.git/blob - js/LDAPGroupEditor.js
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 let groupField
= this.lookupReference('groupField');
28 groupField
.setProfile(values
.profile
);
31 me
.callParent([values
]);
36 xclass
: 'Ext.app.ViewController',
38 changeMode: function(f
, value
) {
39 let groupField
= this.lookupReference('groupField');
40 groupField
.setDisabled(value
!== 'group');
41 groupField
.setVisible(value
=== 'group');
42 let profileField
= this.lookupReference('profileField');
43 let enabled
= (value
!== 'any') && (value
!== 'none');
44 profileField
.setDisabled(!enabled
);
45 profileField
.setVisible(enabled
);
48 changeProfile: function(f
, value
) {
49 let 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',
97 onlineHelp
: 'pmgconfig_ldap',
101 items
: [{ xtype
: 'pmgLDAPGroupInputPanel' }],