|
|
@ -54,6 +54,8 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
|
|
|
|
|
|
|
|
_panelInfo: PanelInfo; |
|
|
|
_panelInfo: PanelInfo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private _analyticUnitTypes: any; |
|
|
|
|
|
|
|
|
|
|
|
panelDefaults = { |
|
|
|
panelDefaults = { |
|
|
|
// datasource name, null = default datasource
|
|
|
|
// datasource name, null = default datasource
|
|
|
|
datasource: null, |
|
|
|
datasource: null, |
|
|
@ -137,14 +139,6 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
seriesOverrides: [], |
|
|
|
seriesOverrides: [], |
|
|
|
thresholds: [], |
|
|
|
thresholds: [], |
|
|
|
anomalyType: '', |
|
|
|
anomalyType: '', |
|
|
|
analyticUnitTypes: [ |
|
|
|
|
|
|
|
{ name: 'General', value: 'GENERAL' }, |
|
|
|
|
|
|
|
{ name: 'Peaks', value: 'PEAK' }, |
|
|
|
|
|
|
|
{ name: 'Troughs', value: 'TROUGH' }, |
|
|
|
|
|
|
|
{ name: 'Jumps', value: 'JUMP' }, |
|
|
|
|
|
|
|
{ name: 'Drops', value: 'DROP' }, |
|
|
|
|
|
|
|
{ name: 'Custom', value: 'CUSTOM' } |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** @ngInject */ |
|
|
|
/** @ngInject */ |
|
|
@ -168,6 +162,8 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
|
|
|
|
|
|
|
|
this.analyticService = new AnalyticService(this.backendURL, $http, this.backendSrv, this.alertSrv); |
|
|
|
this.analyticService = new AnalyticService(this.backendURL, $http, this.backendSrv, this.alertSrv); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.updateAnalyticUnitTypes(); |
|
|
|
|
|
|
|
|
|
|
|
this.runBackendConnectivityCheck(); |
|
|
|
this.runBackendConnectivityCheck(); |
|
|
|
|
|
|
|
|
|
|
|
this.analyticsController = new AnalyticController(this.panel, this.analyticService, this.events); |
|
|
|
this.analyticsController = new AnalyticController(this.panel, this.analyticService, this.events); |
|
|
@ -219,6 +215,15 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
return val; |
|
|
|
return val; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async updateAnalyticUnitTypes(){ |
|
|
|
|
|
|
|
const analyticUnitTypes = await this.analyticService.getAnalyticUnitTypes(); |
|
|
|
|
|
|
|
this._analyticUnitTypes = analyticUnitTypes; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get analyticUnitTypes() { |
|
|
|
|
|
|
|
return this._analyticUnitTypes; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async runBackendConnectivityCheck() { |
|
|
|
async runBackendConnectivityCheck() { |
|
|
|
if(this.backendURL === '' || this.backendURL === undefined) { |
|
|
|
if(this.backendURL === '' || this.backendURL === undefined) { |
|
|
|
this.alertSrv.set( |
|
|
|
this.alertSrv.set( |
|
|
|