diff --git a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts index f977a6e90a..70ff6aa4df 100644 --- a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts +++ b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts @@ -72,6 +72,9 @@ export class MonitorListComponent implements OnInit, OnDestroy { appSearchOrigin: any[] = []; appSearchLoading = false; intervalId: any; + // save the current sorting status + currentSortField: string | null = null; + currentSortOrder: string | null = null; switchExportTypeModalFooter: ModalButtonOptions[] = [ { label: this.i18nSvc.fanyi('common.button.cancel'), type: 'default', onClick: () => (this.isSwitchExportTypeModalVisible = false) } @@ -149,7 +152,7 @@ export class MonitorListComponent implements OnInit, OnDestroy { } sync() { - this.loadMonitorTable(); + this.loadMonitorTable(this.currentSortField, this.currentSortOrder); } getAppIconName(app: string | undefined): string { @@ -499,9 +502,9 @@ export class MonitorListComponent implements OnInit, OnDestroy { this.pageIndex = pageIndex; this.pageSize = pageSize; const currentSort = sort.find(item => item.value !== null); - const sortField = (currentSort && currentSort.key) || null; - const sortOrder = (currentSort && currentSort.value) || null; - this.changeMonitorTable(sortField, sortOrder); + this.currentSortField = (currentSort && currentSort.key) || null; + this.currentSortOrder = (currentSort && currentSort.value) || null; + this.changeMonitorTable(this.currentSortField, this.currentSortOrder); } // begin: app type search filter