mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-01 06:47:33 +02:00
Merge pull request #2871 from pengpengshui/master
fix #2839 about project log has no logs
This commit is contained in:
commit
7a0fe1034a
@ -32,7 +32,7 @@ export const LOG_TEMPLATE: string = `
|
||||
</clr-dg-row>
|
||||
<clr-dg-footer>
|
||||
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
|
||||
of {{pagination.totalItems}} {{'AUDIT_LOG.ITEMS' | translate}}
|
||||
{{'AUDIT_LOG.OF' | translate}} {{pagination.totalItems}} {{'AUDIT_LOG.ITEMS' | translate}}
|
||||
<clr-dg-pagination #pagination [(clrDgPage)]="currentPage" [clrDgPageSize]="pageSize" [clrDgTotalItems]="totalCount"></clr-dg-pagination>
|
||||
</clr-dg-footer>
|
||||
</clr-datagrid>
|
||||
|
@ -58,7 +58,7 @@
|
||||
<clr-dg-footer>
|
||||
<span *ngIf="pagination.totalItems">{{pagination.firstItem + 1}} - {{pagination.lastItem +1 }} {{'AUDIT_LOG.OF' | translate}} </span>
|
||||
{{pagination.totalItems }} {{'AUDIT_LOG.ITEMS' | translate}}
|
||||
<clr-dg-pagination #pagination [clrDgPageSize]="15"></clr-dg-pagination>
|
||||
<clr-dg-pagination #pagination [clrDgPageSize]="15" [(clrDgPage)]="currentPage" [clrDgTotalItems]="totalRecordCount"></clr-dg-pagination>
|
||||
<!--{{totalRecordCount}} {{'AUDIT_LOG.ITEMS' | translate}}
|
||||
<clr-dg-pagination [clrDgPageSize]="pageOffset" [clrDgTotalItems]="totalPage"></clr-dg-pagination>-->
|
||||
</clr-dg-footer>
|
||||
|
@ -69,6 +69,7 @@ export class AuditLogComponent implements OnInit {
|
||||
pageOffset: number = 1;
|
||||
pageSize: number = 15;
|
||||
totalRecordCount: number;
|
||||
currentPage: number;
|
||||
totalPage: number;
|
||||
|
||||
@ViewChild('fromTime') fromTimeInput: NgModel;
|
||||
@ -96,14 +97,14 @@ export class AuditLogComponent implements OnInit {
|
||||
|
||||
retrieve(state?: State): void {
|
||||
if(state) {
|
||||
this.queryParam.page = state.page.to + 1;
|
||||
this.queryParam.page = Math.ceil((state.page.to + 1) / this.pageSize);
|
||||
this.currentPage = this.queryParam.page;
|
||||
}
|
||||
this.auditLogService
|
||||
.listAuditLogs(this.queryParam)
|
||||
.subscribe(
|
||||
response=>{
|
||||
this.totalRecordCount = response.headers.get('x-total-count');
|
||||
this.totalPage = Math.ceil(this.totalRecordCount / this.pageSize);
|
||||
this.totalRecordCount =parseInt(response.headers.get('x-total-count'));
|
||||
this.auditLogs = response.json();
|
||||
},
|
||||
error=>{
|
||||
|
Loading…
Reference in New Issue
Block a user