From 256289810de7171c20c6d772473e52223f02a26d Mon Sep 17 00:00:00 2001 From: FangyuanCheng Date: Mon, 24 Dec 2018 00:06:04 +0800 Subject: [PATCH] Fix download certificate link bug Signed-off-by: FangyuanCheng --- .../repository-gridview.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 c0f7e2d44..2262ff127 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts @@ -8,7 +8,8 @@ import { ChangeDetectorRef, EventEmitter, OnChanges, - SimpleChanges + SimpleChanges, + Inject } from "@angular/core"; import { Router } from "@angular/router"; import { forkJoin } from "rxjs"; @@ -35,7 +36,7 @@ import {Tag} from '../service/interface'; import {GridViewComponent} from '../gridview/grid-view.component'; import {OperationService} from "../operation/operation.service"; import {OperateInfo, OperationState, operateChanges} from "../operation/operate"; -import { downloadUrl } from '../service.config'; +import {SERVICE_CONFIG, IServiceConfig, downloadUrl } from '../service.config'; @Component({ selector: "hbr-repository-gridview", templateUrl: "./repository-gridview.component.html", @@ -79,7 +80,8 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit { @ViewChild("gridView") gridView: GridViewComponent; - constructor(private errorHandler: ErrorHandler, + constructor(@Inject(SERVICE_CONFIG) private configInfo: IServiceConfig, + private errorHandler: ErrorHandler, private translateService: TranslateService, private repositoryService: RepositoryService, private systemInfoService: SystemInfoService, @@ -87,6 +89,9 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit { private operationService: OperationService, private ref: ChangeDetectorRef, private router: Router) { + if (this.configInfo && this.configInfo.systemInfoEndpoint) { + this.downloadLink = this.configInfo.systemInfoEndpoint + "/getcert"; + } } public get registryUrl(): string {