mirror of https://github.com/portainer/portainer
save settings draft (#5872)
parent
54d47ebc76
commit
109b27594a
|
@ -4,7 +4,7 @@ const SERVER_TYPES = {
|
||||||
AD: 2,
|
AD: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
import { buildOpenLDAPSettingsModel } from '@/portainer/settings/authentication/ldap/ldap-settings.model';
|
import { buildLdapSettingsModel, buildOpenLDAPSettingsModel } from '@/portainer/settings/authentication/ldap/ldap-settings.model';
|
||||||
import { EXTERNAL_AUTH_LDAP } from '@/portainer/feature-flags/feature-ids';
|
import { EXTERNAL_AUTH_LDAP } from '@/portainer/feature-flags/feature-ids';
|
||||||
|
|
||||||
const DEFAULT_GROUP_FILTER = '(objectClass=groupOfNames)';
|
const DEFAULT_GROUP_FILTER = '(objectClass=groupOfNames)';
|
||||||
|
@ -16,6 +16,7 @@ export default class LdapSettingsController {
|
||||||
Object.assign(this, { LDAPService, SERVER_TYPES });
|
Object.assign(this, { LDAPService, SERVER_TYPES });
|
||||||
|
|
||||||
this.tlscaCert = null;
|
this.tlscaCert = null;
|
||||||
|
this.settingsDrafts = {};
|
||||||
|
|
||||||
this.boxSelectorOptions = [
|
this.boxSelectorOptions = [
|
||||||
{ id: 'ldap_custom', value: SERVER_TYPES.CUSTOM, label: 'Custom', icon: 'fa fa-server' },
|
{ id: 'ldap_custom', value: SERVER_TYPES.CUSTOM, label: 'Custom', icon: 'fa fa-server' },
|
||||||
|
@ -37,16 +38,21 @@ export default class LdapSettingsController {
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeServerType(serverType) {
|
onChangeServerType(serverType) {
|
||||||
switch (serverType) {
|
this.settingsDrafts[this.settings.ServerType] = this.settings;
|
||||||
case SERVER_TYPES.OPEN_LDAP:
|
|
||||||
return this.onChangeToOpenLDAP();
|
if (this.settingsDrafts[serverType]) {
|
||||||
default:
|
this.settings = this.settingsDrafts[serverType];
|
||||||
break;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeToOpenLDAP() {
|
switch (serverType) {
|
||||||
|
case SERVER_TYPES.OPEN_LDAP:
|
||||||
this.settings = buildOpenLDAPSettingsModel();
|
this.settings = buildOpenLDAPSettingsModel();
|
||||||
|
break;
|
||||||
|
case SERVER_TYPES.CUSTOM:
|
||||||
|
this.settings = buildLdapSettingsModel();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
searchUsers() {
|
searchUsers() {
|
||||||
|
|
Loading…
Reference in New Issue