mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 21:54:13 +01:00
Add pagination to replication rules searching (#14464)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
6fe9ec4ede
commit
f0b241c695
@ -52,6 +52,7 @@ export class ListReplicationRuleComponent {
|
|||||||
@Input() hasUpdateReplicationPermission: boolean;
|
@Input() hasUpdateReplicationPermission: boolean;
|
||||||
@Input() hasDeleteReplicationPermission: boolean;
|
@Input() hasDeleteReplicationPermission: boolean;
|
||||||
@Input() hasExecuteReplicationPermission: boolean;
|
@Input() hasExecuteReplicationPermission: boolean;
|
||||||
|
@Input() searchString: string;
|
||||||
@Output() selectOne = new EventEmitter<ReplicationRule>();
|
@Output() selectOne = new EventEmitter<ReplicationRule>();
|
||||||
@Output() editOne = new EventEmitter<ReplicationRule>();
|
@Output() editOne = new EventEmitter<ReplicationRule>();
|
||||||
@Output() toggleOne = new EventEmitter<ReplicationRule>();
|
@Output() toggleOne = new EventEmitter<ReplicationRule>();
|
||||||
@ -68,7 +69,6 @@ export class ListReplicationRuleComponent {
|
|||||||
page: number = 1;
|
page: number = 1;
|
||||||
pageSize: number = 5;
|
pageSize: number = 5;
|
||||||
totalCount: number = 0;
|
totalCount: number = 0;
|
||||||
ruleName: string = "";
|
|
||||||
loading: boolean = true;
|
loading: boolean = true;
|
||||||
|
|
||||||
constructor(private replicationService: ReplicationService,
|
constructor(private replicationService: ReplicationService,
|
||||||
@ -232,7 +232,7 @@ export class ListReplicationRuleComponent {
|
|||||||
}
|
}
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.replicationService.getReplicationRulesResponse(
|
this.replicationService.getReplicationRulesResponse(
|
||||||
this.ruleName,
|
this.searchString,
|
||||||
this.page,
|
this.page,
|
||||||
this.pageSize)
|
this.pageSize)
|
||||||
.pipe(finalize(() => this.loading = false))
|
.pipe(finalize(() => this.loading = false))
|
||||||
@ -255,7 +255,7 @@ export class ListReplicationRuleComponent {
|
|||||||
this.page = 1;
|
this.page = 1;
|
||||||
this.totalCount = 0;
|
this.totalCount = 0;
|
||||||
this.selectedRow = null;
|
this.selectedRow = null;
|
||||||
this.ruleName = "";
|
this.searchString = null;
|
||||||
this.clrLoad();
|
this.clrLoad();
|
||||||
}
|
}
|
||||||
isHelmHub(srcRegistry: any): boolean {
|
isHelmHub(srcRegistry: any): boolean {
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
[hasUpdateReplicationPermission]="hasUpdateReplicationPermission"
|
[hasUpdateReplicationPermission]="hasUpdateReplicationPermission"
|
||||||
[hasDeleteReplicationPermission]="hasDeleteReplicationPermission"
|
[hasDeleteReplicationPermission]="hasDeleteReplicationPermission"
|
||||||
[hasExecuteReplicationPermission]="hasExecuteReplicationPermission"
|
[hasExecuteReplicationPermission]="hasExecuteReplicationPermission"
|
||||||
|
[searchString]="filterComponent?.currentValue"
|
||||||
></hbr-list-replication-rule>
|
></hbr-list-replication-rule>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 jobList" [hidden]='hiddenJobList'>
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 jobList" [hidden]='hiddenJobList'>
|
||||||
|
@ -168,7 +168,8 @@ export class ReplicationComponent implements OnInit, OnDestroy {
|
|||||||
switchMap( ruleName => {
|
switchMap( ruleName => {
|
||||||
this.listReplicationRule.loading = true;
|
this.listReplicationRule.loading = true;
|
||||||
this.listReplicationRule.page = 1;
|
this.listReplicationRule.page = 1;
|
||||||
return this.replicationService.getReplicationRulesResponse(ruleName);
|
return this.replicationService
|
||||||
|
.getReplicationRulesResponse(ruleName, this.listReplicationRule.page, this.listReplicationRule.pageSize);
|
||||||
})
|
})
|
||||||
).subscribe(response => {
|
).subscribe(response => {
|
||||||
this.hideJobs();
|
this.hideJobs();
|
||||||
@ -176,7 +177,7 @@ export class ReplicationComponent implements OnInit, OnDestroy {
|
|||||||
if (response.headers) {
|
if (response.headers) {
|
||||||
let xHeader: string = response.headers.get("x-total-count");
|
let xHeader: string = response.headers.get("x-total-count");
|
||||||
if (xHeader) {
|
if (xHeader) {
|
||||||
this.totalCount = parseInt(xHeader, 0);
|
this.listReplicationRule.totalCount = parseInt(xHeader, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.listReplicationRule.selectedRow = null; // Clear selection
|
this.listReplicationRule.selectedRow = null; // Clear selection
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
</clr-input-container>
|
</clr-input-container>
|
||||||
<clr-input-container>
|
<clr-input-container>
|
||||||
<label>{{'PROFILE.COMMENT' | translate}}</label>
|
<label>{{'PROFILE.COMMENT' | translate}}</label>
|
||||||
<input clrInput type="text" #commentInput="ngModel" name="comment" [(ngModel)]="newUser.comment" maxLengthExt="20" id="comment" size="30"
|
<input clrInput type="text" #commentInput="ngModel" name="comment" [(ngModel)]="newUser.comment" maxLengthExt="30" id="comment" size="30"
|
||||||
(input)='handleValidation("comment", false)' (blur)='handleValidation("comment", true)'>
|
(input)='handleValidation("comment", false)' (blur)='handleValidation("comment", true)'>
|
||||||
<clr-control-error *ngIf='getValidationState("comment")'>
|
<clr-control-error *ngIf='getValidationState("comment")'>
|
||||||
{{'TOOLTIP.COMMENT' | translate}}
|
{{'TOOLTIP.COMMENT' | translate}}
|
||||||
|
Loading…
Reference in New Issue
Block a user