[webapp] bugfix monitors pageable not work (#2602)

Signed-off-by: tomsun28 <tomsun28@outlook.com>
Co-authored-by: shown <yuluo08290126@gmail.com>
This commit is contained in:
tomsun28
2024-08-27 11:02:58 +08:00
committed by GitHub
co-authored by shown
parent 6e430bcab6
commit 525980f919
2 changed files with 1 additions and 33 deletions
@@ -506,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
@@ -114,38 +114,6 @@ export class MonitorService {
return this.http.get<Message<Monitor[]>>(`${monitors_uri}/${app}`);
}
public getMonitors(
app: string | undefined,
tag: string | undefined,
pageIndex: number,
pageSize: number,
sortField?: string | null,
sortOrder?: string | null
): Observable<Message<Page<Monitor>>> {
pageIndex = pageIndex ? pageIndex : 0;
pageSize = pageSize ? pageSize : 8;
// HttpParams is unmodifiable, so we need to save the return value of append/set
let httpParams = new HttpParams();
httpParams = httpParams.appendAll({
pageIndex: pageIndex,
pageSize: pageSize
});
if (app != undefined) {
httpParams = httpParams.append('app', app.trim());
}
if (tag != undefined) {
httpParams = httpParams.append('tag', tag);
}
if (sortField != null && sortOrder != null) {
httpParams = httpParams.appendAll({
sort: sortField,
order: sortOrder == 'ascend' ? 'asc' : 'desc'
});
}
const options = { params: httpParams };
return this.http.get<Message<Page<Monitor>>>(monitors_uri, options);
}
public searchMonitors(
app: string | undefined,
tag: string | undefined,