mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-17 04:11:24 +01:00
Modify usage of LDAP ping API on UI (#14440)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
fb3b1311d8
commit
f03ca3b087
@ -24,6 +24,7 @@ import { clone, isEmpty, getChanges as getChangesFunc } from "../../../../shared
|
|||||||
import { CONFIG_AUTH_MODE } from "../../../../shared/entities/shared.const";
|
import { CONFIG_AUTH_MODE } from "../../../../shared/entities/shared.const";
|
||||||
import { errorHandler } from "../../../../shared/units/shared.utils";
|
import { errorHandler } from "../../../../shared/units/shared.utils";
|
||||||
import { Configuration } from "../config";
|
import { Configuration } from "../config";
|
||||||
|
import { finalize } from "rxjs/operators";
|
||||||
const fakePass = 'aWpLOSYkIzJTTU4wMDkx';
|
const fakePass = 'aWpLOSYkIzJTTU4wMDkx';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -138,11 +139,14 @@ export class ConfigurationAuthComponent implements OnChanges, OnInit {
|
|||||||
settings['ldap_scope'] = +settings['ldap_scope'];
|
settings['ldap_scope'] = +settings['ldap_scope'];
|
||||||
|
|
||||||
this.configService.testLDAPServer(settings)
|
this.configService.testLDAPServer(settings)
|
||||||
.subscribe(respone => {
|
.pipe(finalize(() => this.testingOnGoing = false))
|
||||||
this.testingOnGoing = false;
|
.subscribe(res => {
|
||||||
this.msgHandler.showSuccess('CONFIG.TEST_LDAP_SUCCESS');
|
if (res && res.success) {
|
||||||
|
this.msgHandler.showSuccess('CONFIG.TEST_LDAP_SUCCESS');
|
||||||
|
} else if (res && res.message) {
|
||||||
|
this.msgHandler.showError('CONFIG.TEST_LDAP_FAILED', { 'param': res.message });
|
||||||
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
this.testingOnGoing = false;
|
|
||||||
let err = errorHandler(error);
|
let err = errorHandler(error);
|
||||||
if (!err || !err.trim()) {
|
if (!err || !err.trim()) {
|
||||||
err = 'UNKNOWN';
|
err = 'UNKNOWN';
|
||||||
|
Loading…
Reference in New Issue
Block a user