Hide the helmcharts tab when chart museum is not installed.

Add parameter for receving chartmuseum installation state.
Using that to decide the presentation of helmchart tab in project.
This commit is contained in:
Deng, Qian 2018-08-03 10:56:06 +08:00
parent a7fc977bc3
commit 66d85a12b4
4 changed files with 8 additions and 1 deletions

View File

@ -201,6 +201,7 @@ export interface SystemInfo {
with_clair?: boolean;
with_notary?: boolean;
with_admiral?: boolean;
with_chartmuseum?: boolean;
admiral_endpoint?: string;
auth_mode?: string;
registry_url?: string;

View File

@ -28,6 +28,7 @@ export class AppConfig {
next_scan_all: number;
registry_storage_provider_name: string;
read_only: boolean;
with_chartmuseum: boolean;
constructor() {
// Set default value
@ -48,5 +49,6 @@ export class AppConfig {
this.next_scan_all = 0;
this.registry_storage_provider_name = "";
this.read_only = false;
this.with_chartmuseum = false;
}
}

View File

@ -7,7 +7,7 @@
<li class="nav-item">
<a class="nav-link" routerLink="repositories" routerLinkActive="active">{{'PROJECT_DETAIL.REPOSITORIES' | translate}}</a>
</li>
<li class="nav-item">
<li *ngIf="withHelmChart" class="nav-item">
<a class="nav-link" routerLink="helm-charts" routerLinkActive="active">{{'PROJECT_DETAIL.HELMCHART' | translate}}</a>
</li>
<li class="nav-item" *ngIf="isSystemAdmin || isMember">

View File

@ -67,6 +67,10 @@ export class ProjectDetailComponent {
return this.appConfigService.getConfig().with_admiral;
}
public get withHelmChart(): boolean {
return this.appConfigService.getConfig().with_chartmuseum;
}
backToProject(): void {
if (window.sessionStorage) {
window.sessionStorage.setItem('fromDetails', 'true');