[manager,webapp]feature 监控列表支持过滤搜索 (#29)

This commit is contained in:
tomsun28
2022-03-15 16:21:25 +08:00
committed by GitHub
parent 540f4bcbf4
commit 4db3e04dd6
6 changed files with 104 additions and 29 deletions

View File

@@ -88,17 +88,28 @@ export class MonitorService {
return this.http.get<Message<Page<Monitor>>>(monitors_uri, options);
}
public searchMonitors(monitorName: string, monitorHost: string, pageIndex: number, pageSize: number): Observable<Message<Page<Monitor>>> {
public searchMonitors(
app: string | null,
searchValue: string,
status: number,
pageIndex: number,
pageSize: number
): Observable<Message<Page<Monitor>>> {
pageIndex = pageIndex ? pageIndex : 0;
pageSize = pageSize ? pageSize : 8;
status = status ? status : 9;
// 注意HttpParams是不可变对象 需要保存set后返回的对象为最新对象
let httpParams = new HttpParams();
httpParams = httpParams.appendAll({
name: monitorName,
host: monitorHost,
name: searchValue,
host: searchValue,
status: status,
pageIndex: pageIndex,
pageSize: pageSize
});
if (app != undefined) {
httpParams = httpParams.append('app', app);
}
const options = { params: httpParams };
return this.http.get<Message<Page<Monitor>>>(monitors_uri, options);
}