Merge pull request #9189 from strainovic/patch-1

Use external_url if exists on Add Repo Command chart details page
This commit is contained in:
Will Sun 2019-10-15 12:18:37 +08:00 committed by GitHub
commit 285d3e1e5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,12 +44,16 @@ export class ChartDetailComponent implements OnInit {
ngOnInit(): void {
this.systemInfoService.getSystemInfo()
.subscribe(systemInfo => {
let scheme = 'http://';
this.systemInfo = systemInfo;
if (this.systemInfo.has_ca_root) {
scheme = 'https://';
if (this.systemInfo.external_url) {
this.repoURL = `${this.systemInfo.external_url}`;
} else {
let scheme = 'http://';
if (this.systemInfo.has_ca_root) {
scheme = 'https://';
}
this.repoURL = `${scheme}${this.systemInfo.registry_url}`;
}
this.repoURL = `${scheme}${this.systemInfo.registry_url}`;
}, error => this.errorHandler.error(error));
this.refresh();
}