Skip to content

Commit

Permalink
[bugfix] fix monitor search sync error (apache#2546)
Browse files Browse the repository at this point in the history
Co-authored-by: YuLuo <yuluo08290126@gmail.com>
  • Loading branch information
Aias00 and yuluo-yx authored Aug 17, 2024
1 parent e157d82 commit 4733ac2
Showing 1 changed file with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,28 @@ export class MonitorListComponent implements OnInit, OnDestroy {

loadMonitorTable(sortField?: string | null, sortOrder?: string | null) {
this.tableLoading = true;
let monitorInit$ = this.monitorSvc.getMonitors(this.app, this.tag, this.pageIndex - 1, this.pageSize, sortField, sortOrder).subscribe(
message => {
this.tableLoading = false;
this.checkedAll = false;
this.checkedMonitorIds.clear();
if (message.code === 0) {
let page = message.data;
this.monitors = page.content;
this.pageIndex = page.number + 1;
this.total = page.totalElements;
} else {
console.warn(message.msg);
let monitorInit$ = this.monitorSvc
.searchMonitors(this.app, this.tag, this.filterContent, this.filterStatus, this.pageIndex - 1, this.pageSize, sortField, sortOrder)
.subscribe(
message => {
this.tableLoading = false;
this.checkedAll = false;
this.checkedMonitorIds.clear();
if (message.code === 0) {
let page = message.data;
this.monitors = page.content;
this.pageIndex = page.number + 1;
this.total = page.totalElements;
} else {
console.warn(message.msg);
}
monitorInit$.unsubscribe();
},
error => {
this.tableLoading = false;
monitorInit$.unsubscribe();
}
monitorInit$.unsubscribe();
},
error => {
this.tableLoading = false;
monitorInit$.unsubscribe();
}
);
);
}
changeMonitorTable(sortField?: string | null, sortOrder?: string | null) {
this.tableLoading = true;
Expand Down Expand Up @@ -504,7 +506,7 @@ export class MonitorListComponent implements OnInit, OnDestroy {
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.changeMonitorTable(sortField, sortOrder);
}

// begin: app type search filter
Expand Down

0 comments on commit 4733ac2

Please sign in to comment.