use endpoint for gc log

Signed-off-by: Meina Zhou <meinaz@vmware.com>
This commit is contained in:
Meina Zhou 2019-04-24 17:04:44 +08:00
parent 9bd2de3e35
commit f0d9b41bf5
5 changed files with 17 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@harbor/ui", "name": "@harbor/ui",
"version": "1.7.1-rc1", "version": "1.7.4-rc2",
"description": "Harbor shared UI components based on Clarity and Angular6", "description": "Harbor shared UI components based on Clarity and Angular6",
"author": "CNCF", "author": "CNCF",
"module": "index.js", "module": "index.js",

View File

@ -13,7 +13,7 @@
<clr-dg-cell>{{job.createTime | date:'medium'}}</clr-dg-cell> <clr-dg-cell>{{job.createTime | date:'medium'}}</clr-dg-cell>
<clr-dg-cell>{{job.updateTime | date:'medium'}}</clr-dg-cell> <clr-dg-cell>{{job.updateTime | date:'medium'}}</clr-dg-cell>
<clr-dg-cell> <clr-dg-cell>
<a *ngIf="job.status.toLowerCase() === 'finished' || job.status.toLowerCase() === 'error'" target="_blank" href="/api/system/gc/{{job.id}}/log"><clr-icon shape="list"></clr-icon></a> <a *ngIf="job.status.toLowerCase() === 'finished' || job.status.toLowerCase() === 'error'" target="_blank" [href]="getLogLink(job.id)"><clr-icon shape="list"></clr-icon></a>
</clr-dg-cell> </clr-dg-cell>
</clr-dg-row> </clr-dg-row>
<clr-dg-footer>{{'GC.LATEST_JOBS' | translate :{param: jobs.length} }}</clr-dg-footer> <clr-dg-footer>{{'GC.LATEST_JOBS' | translate :{param: jobs.length} }}</clr-dg-footer>

View File

@ -13,7 +13,7 @@ export class GcHistoryComponent implements OnInit {
constructor( constructor(
private gcRepoService: GcRepoService, private gcRepoService: GcRepoService,
private gcViewModelFactory: GcViewModelFactory, private gcViewModelFactory: GcViewModelFactory,
) { } ) {}
ngOnInit() { ngOnInit() {
this.getJobs(); this.getJobs();
@ -25,4 +25,8 @@ export class GcHistoryComponent implements OnInit {
}); });
} }
getLogLink(id): string {
return this.gcRepoService.getLogLink(id);
}
} }

View File

@ -17,6 +17,8 @@ export abstract class GcApiRepository {
abstract getStatus(id): Observable<any>; abstract getStatus(id): Observable<any>;
abstract getJobs(): Observable<any>; abstract getJobs(): Observable<any>;
abstract getLogLink(id): string;
} }
@Injectable() @Injectable()
@ -61,4 +63,8 @@ export class GcApiDefaultRepository extends GcApiRepository {
.pipe(map(response => response.json())); .pipe(map(response => response.json()));
} }
public getLogLink(id) {
return `${this.config.gcEndpoint}/${id}/log`;
}
} }

View File

@ -57,4 +57,8 @@ export class GcRepoService {
return this.gcApiRepository.putSchedule(param); return this.gcApiRepository.putSchedule(param);
} }
public getLogLink(id): string {
return this.gcApiRepository.getLogLink(id);
}
} }