[web-app] 监控历史图表详情
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user