diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.html b/src/portal/lib/src/repository-gridview/repository-gridview.component.html index 039927253..6fd137c12 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.html +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.html @@ -3,7 +3,7 @@
- + {{'CONFIG.REGISTRY_CERTIFICATE' | translate | uppercase}} diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts index 2262ff127..6f885a8f1 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts @@ -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(); @Output() repoProvisionEvent = new EventEmitter(); @@ -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(); diff --git a/src/portal/src/app/repository/repository-page.component.html b/src/portal/src/app/repository/repository-page.component.html index fb579e7e4..e041726d9 100644 --- a/src/portal/src/app/repository/repository-page.component.html +++ b/src/portal/src/app/repository/repository-page.component.html @@ -1,5 +1,5 @@
-
\ No newline at end of file diff --git a/src/portal/src/app/repository/repository-page.component.ts b/src/portal/src/app/repository/repository-page.component.ts index 662b6946b..ee9e847ba 100644 --- a/src/portal/src/app/repository/repository-page.component.ts +++ b/src/portal/src/app/repository/repository-page.component.ts @@ -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; + } }