mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 18:55:18 +01:00
Merge pull request #6621 from pureshine/download-cert
When harbor is deployed in http mode, the registry certificate download button is not displayed in the project page.
This commit is contained in:
commit
9a597e274f
@ -3,7 +3,7 @@
|
||||
<div class="toolbar">
|
||||
<div class="row flex-items-xs-right option-right rightPos">
|
||||
<div class="flex-xs-middle">
|
||||
<a #certDownloadLink [href]="downloadLink" target="_blank" class="btn btn-link btn-font download-link">
|
||||
<a #certDownloadLink *ngIf="canDownloadCert" [href]="downloadLink" target="_blank" class="btn btn-link btn-font download-link">
|
||||
<clr-icon shape="download"></clr-icon>
|
||||
{{'CONFIG.REGISTRY_CERTIFICATE' | translate | uppercase}}
|
||||
</a>
|
||||
|
@ -51,6 +51,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
||||
@Input() urlPrefix: string;
|
||||
@Input() hasSignedIn: boolean;
|
||||
@Input() hasProjectAdminRole: boolean;
|
||||
@Input() hasCAFile: boolean = false;
|
||||
@Input() mode = "admiral";
|
||||
@Output() repoClickEvent = new EventEmitter<RepositoryItem>();
|
||||
@Output() repoProvisionEvent = new EventEmitter<RepositoryItem>();
|
||||
@ -118,6 +119,10 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
||||
return this.withClair && !this.isClairDBReady;
|
||||
}
|
||||
|
||||
get canDownloadCert(): boolean {
|
||||
return this.hasCAFile;
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes["projectId"] && changes["projectId"].currentValue) {
|
||||
this.refresh();
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<hbr-repository-gridview [projectId]="projectId" [projectName]="projectName" [hasSignedIn]="hasSignedIn"
|
||||
<hbr-repository-gridview [projectId]="projectId" [projectName]="projectName" [hasSignedIn]="hasSignedIn" [hasCAFile]="hasCAFile"
|
||||
[hasProjectAdminRole]="hasProjectAdminRole" [mode]="mode"
|
||||
(repoClickEvent)="watchRepoClickEvent($event)"></hbr-repository-gridview>
|
||||
</div>
|
@ -17,7 +17,7 @@ import { RepositoryItem } from '@harbor/ui';
|
||||
|
||||
import { Project } from '../project/project';
|
||||
import { SessionService } from '../shared/session.service';
|
||||
|
||||
import { AppConfigService } from '../app-config.service';
|
||||
@Component({
|
||||
selector: 'repository',
|
||||
templateUrl: 'repository-page.component.html'
|
||||
@ -32,7 +32,8 @@ export class RepositoryPageComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private session: SessionService,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
private appConfigService: AppConfigService,
|
||||
) {
|
||||
}
|
||||
|
||||
@ -51,4 +52,8 @@ export class RepositoryPageComponent implements OnInit {
|
||||
let linkUrl = ['harbor', 'projects', repoEvt.project_id, 'repositories', repoEvt.name];
|
||||
this.router.navigate(linkUrl);
|
||||
}
|
||||
|
||||
public get hasCAFile(): boolean {
|
||||
return this.appConfigService.getConfig().has_ca_root;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user