[web-app] 监控历史图表详情

This commit is contained in:
tomsun28
2022-01-30 14:00:46 +08:00
parent ef7f71952b
commit c661dfcdbb
15 changed files with 493 additions and 96 deletions

View File

@@ -21,6 +21,13 @@ export class AppDefineService {
return this.http.get<Message<ParamDefine[]>>(paramDefineUri);
}
public getAppDefine(app: string | undefined | null): Observable<Message<any>> {
if (app === null || app === undefined) {
console.log('getAppDefine app can not null');
}
return this.http.get<Message<any>>(`/apps/${app}/define`);
}
public getAppHierarchy(): Observable<Message<any>> {
let httpParams = new HttpParams().append('lang', 'zh-CN');
const options = { params: httpParams };

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
const Authorization = 'Authorization';
const refreshToken = 'refresh-token';
const AuthorizationConst = 'Authorization';
const RefreshTokenConst = 'refresh-token';
@Injectable({
providedIn: 'root'
@@ -19,23 +19,23 @@ export class LocalStorageService {
}
public getAuthorizationToken(): string | null {
return this.getData(Authorization);
return this.getData(AuthorizationConst);
}
public getRefreshToken(): string | null {
return this.getData(refreshToken);
return this.getData(RefreshTokenConst);
}
public storageRefreshToken(token: string) {
return this.putData(refreshToken, token);
return this.putData(RefreshTokenConst, token);
}
public storageAuthorizationToken(token: string) {
return this.putData(Authorization, token);
return this.putData(AuthorizationConst, token);
}
public hasAuthorizationToken() {
return localStorage.getItem(Authorization) != null;
return localStorage.getItem(AuthorizationConst) != null;
}
public clear() {

View File

@@ -107,6 +107,24 @@ export class MonitorService {
return this.http.get<Message<any>>(`/monitor/${monitorId}/metrics/${metrics}`);
}
public getMonitorMetricHistoryData(
monitorId: number,
app: string,
metrics: string,
metric: string,
history: string,
interval: boolean
): Observable<Message<any>> {
let metricFull = `${app}.${metrics}.${metric}`;
let httpParams = new HttpParams();
httpParams = httpParams.appendAll({
history: history,
interval: interval
});
const options = { params: httpParams };
return this.http.get<Message<any>>(`/monitor/${monitorId}/metric/${metricFull}`, options);
}
public getAppsMonitorSummary(): Observable<Message<any>> {
return this.http.get<Message<any>>(summary_uri);
}