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