mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-14 10:51:25 +01:00
Merge pull request #3890 from ninjadq/uaa_ui
Add UI Component for UAA Auth
This commit is contained in:
commit
7a0dbafad6
@ -15,6 +15,30 @@
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="form-block" *ngIf="showUAA">
|
||||
<div class="form-group">
|
||||
<label for="uaa-endpoint" class="required">{{'CONFIG.UAA.ENDPOINT' | translate}}</label>
|
||||
<input type="text" id="uaa-endpoint" name="uaa-endpoint" size="35"
|
||||
[(ngModel)]="currentConfig.uaa_endpoint.value" [disabled]="!currentConfig.uaa_verify_cert.editable">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="uaa-id" class="required">{{'CONFIG.UAA.CLIENT_ID' | translate}}</label>
|
||||
<input type="text" id="uaa-cid" name="uaa-client-id" size="35"
|
||||
[(ngModel)]="currentConfig.uaa_client_id.value" [disabled]="!currentConfig.uaa_verify_cert.editable">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="uaa-id" class="required">{{'CONFIG.UAA.CLIENT_SECRET' | translate}}</label>
|
||||
<input type="text" id="uaa-secret" name="uaa-client-secret" type="password" size="35"
|
||||
[(ngModel)]="currentConfig.uaa_client_secret.value" [disabled]="!currentConfig.uaa_verify_cert.editable">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="uaa-cert" class="required">{{'CONFIG.UAA.VERIFY_CERT' | translate}}</label>
|
||||
<clr-checkbox id="uaa-cert" name="uaa-cert" [(clrChecked)]="currentConfig.uaa_verify_cert.value"
|
||||
[clrDisabled]="!currentConfig.uaa_verify_cert.editable"></clr-checkbox>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="form-block" *ngIf="showLdap">
|
||||
<div class="form-group">
|
||||
<label for="ldapUrl" class="required">{{'CONFIG.LDAP.URL' | translate}}</label>
|
||||
|
@ -24,7 +24,7 @@ import { Configuration } from 'harbor-ui';
|
||||
})
|
||||
export class ConfigurationAuthComponent implements OnChanges {
|
||||
changeSub: Subscription;
|
||||
@Input("ldapConfig") currentConfig: Configuration = new Configuration();
|
||||
@Input("allConfig") currentConfig: Configuration = new Configuration();
|
||||
|
||||
@ViewChild("authConfigFrom") authForm: NgForm;
|
||||
|
||||
@ -50,6 +50,10 @@ export class ConfigurationAuthComponent implements OnChanges {
|
||||
this.currentConfig.auth_mode.value === 'ldap_auth';
|
||||
}
|
||||
|
||||
public get showUAA(): boolean {
|
||||
return this.currentConfig && this.currentConfig.auth_mode && this.currentConfig.auth_mode.value === 'uaa_auth';
|
||||
}
|
||||
|
||||
public get showSelfReg(): boolean {
|
||||
if (!this.currentConfig || !this.currentConfig.auth_mode) {
|
||||
return true;
|
||||
|
@ -8,4 +8,12 @@
|
||||
|
||||
.info-tips-icon:hover {
|
||||
color: #007CBB;
|
||||
}
|
||||
|
||||
clr-icon {
|
||||
color: grey;
|
||||
margin-top: -3px;
|
||||
}
|
||||
clr-icon:hover {
|
||||
color: #007CBB;
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
<section id="authentication" role="tabpanel" aria-labelledby="config-auth" [hidden]='!isCurrentTabContent("authentication")'>
|
||||
<config-auth [ldapConfig]="allConfig"></config-auth>
|
||||
<config-auth [allConfig]="allConfig"></config-auth>
|
||||
</section>
|
||||
<section id="email" role="tabpanel" aria-labelledby="config-email" [hidden]='!isCurrentTabContent("email")'>
|
||||
<config-email [mailConfig]="allConfig"></config-email>
|
||||
|
@ -50,13 +50,13 @@ const TabLinkContentMap = {
|
||||
styleUrls: ['config.component.css']
|
||||
})
|
||||
export class ConfigurationComponent implements OnInit, OnDestroy {
|
||||
onGoing: boolean = false;
|
||||
onGoing = false;
|
||||
allConfig: Configuration = new Configuration();
|
||||
currentTabId: string = "config-auth";//default tab
|
||||
currentTabId = 'config-auth'; // default tab
|
||||
originalCopy: Configuration;
|
||||
confirmSub: Subscription;
|
||||
testingMailOnGoing: boolean = false;
|
||||
testingLDAPOnGoing: boolean = false;
|
||||
testingMailOnGoing = false;
|
||||
testingLDAPOnGoing = false;
|
||||
|
||||
@ViewChild(SystemSettingsComponent) systemSettingsConfig: SystemSettingsComponent;
|
||||
@ViewChild(VulnerabilityConfigComponent) vulnerabilityConfig: VulnerabilityConfigComponent;
|
||||
@ -405,7 +405,7 @@ export class ConfigurationComponent implements OnInit, OnDestroy {
|
||||
//Add two password fields
|
||||
configurations.email_password = new StringValueItem(fakePass, true);
|
||||
configurations.ldap_search_password = new StringValueItem(fakePass, true);
|
||||
|
||||
configurations.uaa_client_secret = new StringValueItem(fakePass, false);
|
||||
this.allConfig = configurations;
|
||||
//Keep the original copy of the data
|
||||
this.originalCopy = this.clone(configurations);
|
||||
|
@ -443,6 +443,12 @@
|
||||
"SCOPE": "LDAP Scope",
|
||||
"VERIFY_CERT": "LDAP Verify Cert"
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Endpoint",
|
||||
"CLIENT_ID": "UAA Client ID",
|
||||
"CLIENT_SECRET": "UAA Client Secret",
|
||||
"VERIFY_CERT": "UAA Verify Cert"
|
||||
},
|
||||
"SCANNING": {
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
||||
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}",
|
||||
|
@ -444,6 +444,12 @@
|
||||
"SCOPE": "LDAP Ámbito",
|
||||
"VERIFY_CERT": "LDAP Verify Cert"
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Endpoint",
|
||||
"CLIENT_ID": "UAA Client ID",
|
||||
"CLIENT_SECRET": "UAA Client Secret",
|
||||
"VERIFY_CERT": "UAA Verify Cert"
|
||||
},
|
||||
"SCANNING": {
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "Trigger scan all successfully!",
|
||||
"TRIGGER_SCAN_ALL_FAIL": "Failed to trigger scan all with error: {{error}",
|
||||
|
@ -443,6 +443,12 @@
|
||||
"SCOPE": "LDAP搜索范围",
|
||||
"VERIFY_CERT": "LDAP 检查证书"
|
||||
},
|
||||
"UAA": {
|
||||
"ENDPOINT": "UAA Endpoint",
|
||||
"CLIENT_ID": "UAA Client ID",
|
||||
"CLIENT_SECRET": "UAA Client Secret",
|
||||
"VERIFY_CERT": "UAA 检查证书"
|
||||
},
|
||||
"SCANNING": {
|
||||
"TRIGGER_SCAN_ALL_SUCCESS": "启动扫描所有镜像任务成功!",
|
||||
"TRIGGER_SCAN_ALL_FAIL": "启动扫描所有镜像任务失败:{{error}",
|
||||
|
Loading…
Reference in New Issue
Block a user