From f0d9b41bf561ab965220e6a258a2a15dc3b081a2 Mon Sep 17 00:00:00 2001 From: Meina Zhou Date: Wed, 24 Apr 2019 17:04:44 +0800 Subject: [PATCH] use endpoint for gc log Signed-off-by: Meina Zhou --- src/portal/lib/package.json | 2 +- .../lib/src/config/gc/gc-history/gc-history.component.html | 2 +- .../lib/src/config/gc/gc-history/gc-history.component.ts | 6 +++++- src/portal/lib/src/config/gc/gc.api.repository.ts | 6 ++++++ src/portal/lib/src/config/gc/gc.service.ts | 4 ++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/portal/lib/package.json b/src/portal/lib/package.json index ff9ca5fe5..649f623d0 100644 --- a/src/portal/lib/package.json +++ b/src/portal/lib/package.json @@ -1,6 +1,6 @@ { "name": "@harbor/ui", - "version": "1.7.1-rc1", + "version": "1.7.4-rc2", "description": "Harbor shared UI components based on Clarity and Angular6", "author": "CNCF", "module": "index.js", diff --git a/src/portal/lib/src/config/gc/gc-history/gc-history.component.html b/src/portal/lib/src/config/gc/gc-history/gc-history.component.html index d71057e4d..999619af0 100644 --- a/src/portal/lib/src/config/gc/gc-history/gc-history.component.html +++ b/src/portal/lib/src/config/gc/gc-history/gc-history.component.html @@ -13,7 +13,7 @@ {{job.createTime | date:'medium'}} {{job.updateTime | date:'medium'}} - + {{'GC.LATEST_JOBS' | translate :{param: jobs.length} }} diff --git a/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts b/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts index 29df7c888..bc6ffce97 100644 --- a/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts +++ b/src/portal/lib/src/config/gc/gc-history/gc-history.component.ts @@ -13,7 +13,7 @@ export class GcHistoryComponent implements OnInit { constructor( private gcRepoService: GcRepoService, private gcViewModelFactory: GcViewModelFactory, - ) { } + ) {} ngOnInit() { this.getJobs(); @@ -25,4 +25,8 @@ export class GcHistoryComponent implements OnInit { }); } + getLogLink(id): string { + return this.gcRepoService.getLogLink(id); + } + } diff --git a/src/portal/lib/src/config/gc/gc.api.repository.ts b/src/portal/lib/src/config/gc/gc.api.repository.ts index 5cc5bbf7b..5cf1b64c7 100644 --- a/src/portal/lib/src/config/gc/gc.api.repository.ts +++ b/src/portal/lib/src/config/gc/gc.api.repository.ts @@ -17,6 +17,8 @@ export abstract class GcApiRepository { abstract getStatus(id): Observable; abstract getJobs(): Observable; + + abstract getLogLink(id): string; } @Injectable() @@ -61,4 +63,8 @@ export class GcApiDefaultRepository extends GcApiRepository { .pipe(map(response => response.json())); } + public getLogLink(id) { + return `${this.config.gcEndpoint}/${id}/log`; + } + } diff --git a/src/portal/lib/src/config/gc/gc.service.ts b/src/portal/lib/src/config/gc/gc.service.ts index 9bca2c3b2..b04232377 100644 --- a/src/portal/lib/src/config/gc/gc.service.ts +++ b/src/portal/lib/src/config/gc/gc.service.ts @@ -57,4 +57,8 @@ export class GcRepoService { return this.gcApiRepository.putSchedule(param); } + + public getLogLink(id): string { + return this.gcApiRepository.getLogLink(id); + } }