[manager,webapp] 全局监控搜索框功能实现

This commit is contained in:
tomsun28
2021-12-19 16:08:18 +08:00
parent 8ec8740ab2
commit 9b2638c233
3 changed files with 58 additions and 12 deletions

View File

@@ -88,6 +88,22 @@ 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>>> {
pageIndex = pageIndex ? pageIndex : 0;
pageSize = pageSize ? pageSize : 8;
// 注意HttpParams是不可变对象 需要保存set后返回的对象为最新对象
let httpParams = new HttpParams();
httpParams = httpParams.appendAll({
'name': monitorName,
'host': monitorHost,
'pageIndex': pageIndex,
'pageSize': pageSize
});
const options = { params: httpParams };
return this.http.get<Message<Page<Monitor>>>(monitors_uri, options);
}
public getMonitorMetricData(monitorId: number, metric: string) : Observable<Message<any>> {
return this.http.get<Message<any>>(`/monitors/${monitorId}/metrics/${metric}`);
}