Merge pull request #7506 from zhoumeina/fix_gc

use endpoint for gc log
This commit is contained in:
Mia ZHOU 2019-04-25 10:33:25 +08:00 committed by GitHub
commit 5a9fa17b0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 3 deletions

View File

@ -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",

View File

@ -13,7 +13,7 @@
<clr-dg-cell>{{job.createTime | date:'medium'}}</clr-dg-cell>
<clr-dg-cell>{{job.updateTime | date:'medium'}}</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-row>
<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(
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);
}
}

View File

@ -17,6 +17,8 @@ export abstract class GcApiRepository {
abstract getStatus(id): Observable<any>;
abstract getJobs(): Observable<any>;
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`;
}
}

View File

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