mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 18:19:02 +00:00
[bugfix] retain sorting state after monitor list auto-refresh (#3156)
Co-authored-by: tomsun28 <tomsun28@outlook.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user