|
|
@ -26,14 +26,6 @@ const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL'; |
|
|
|
|
|
|
|
|
|
|
|
class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
static template = template; |
|
|
|
static template = template; |
|
|
|
ANALYTIC_TYPES: Array<{name: string, value: string}> = [ |
|
|
|
|
|
|
|
{ name: 'General', value: 'GENERAL' }, |
|
|
|
|
|
|
|
{ name: 'Peaks', value: 'PEAK' }, |
|
|
|
|
|
|
|
{ name: 'Troughs', value: 'TROUGH' }, |
|
|
|
|
|
|
|
{ name: 'Jumps', value: 'JUMP' }, |
|
|
|
|
|
|
|
{ name: 'Drops', value: 'DROP' }, |
|
|
|
|
|
|
|
{ name: 'Custom', value: 'CUSTOM' } |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hiddenSeries: any = {}; |
|
|
|
hiddenSeries: any = {}; |
|
|
|
seriesList: any = []; |
|
|
|
seriesList: any = []; |
|
|
@ -51,7 +43,7 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
processor: DataProcessor; |
|
|
|
processor: DataProcessor; |
|
|
|
|
|
|
|
|
|
|
|
datasourceRequest: DatasourceRequest; |
|
|
|
datasourceRequest: DatasourceRequest; |
|
|
|
|
|
|
|
|
|
|
|
anomalyTypes = []; // TODO: remove it later. Only for alert tab
|
|
|
|
anomalyTypes = []; // TODO: remove it later. Only for alert tab
|
|
|
|
analyticsController: AnalyticController; |
|
|
|
analyticsController: AnalyticController; |
|
|
|
|
|
|
|
|
|
|
@ -141,6 +133,14 @@ 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 */ |
|
|
@ -159,9 +159,9 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
|
|
|
|
|
|
|
|
this.processor = new DataProcessor(this.panel); |
|
|
|
this.processor = new DataProcessor(this.panel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var anomalyService = new AnalyticService(this.backendURL, backendSrv as BackendSrv); |
|
|
|
var anomalyService = new AnalyticService(this.backendURL, backendSrv as BackendSrv); |
|
|
|
|
|
|
|
|
|
|
|
this.runBackendConnectivityCheck(); |
|
|
|
this.runBackendConnectivityCheck(); |
|
|
|
|
|
|
|
|
|
|
|
this.analyticsController = new AnalyticController(this.panel, anomalyService, this.events); |
|
|
|
this.analyticsController = new AnalyticController(this.panel, anomalyService, this.events); |
|
|
@ -212,8 +212,8 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
async runBackendConnectivityCheck() { |
|
|
|
async runBackendConnectivityCheck() { |
|
|
|
if(this.backendURL === '' || this.backendURL === undefined) { |
|
|
|
if(this.backendURL === '' || this.backendURL === undefined) { |
|
|
|
this.alertSrv.set( |
|
|
|
this.alertSrv.set( |
|
|
|
`Dashboard variable $${BACKEND_VARIABLE_NAME} is missing`,
|
|
|
|
`Dashboard variable $${BACKEND_VARIABLE_NAME} is missing`, |
|
|
|
`Please set $${BACKEND_VARIABLE_NAME}`,
|
|
|
|
`Please set $${BACKEND_VARIABLE_NAME}`, |
|
|
|
'warning', 4000 |
|
|
|
'warning', 4000 |
|
|
|
); |
|
|
|
); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -225,7 +225,7 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
this.alertSrv.set( |
|
|
|
this.alertSrv.set( |
|
|
|
'Can`t connect to Hastic server', `Hastic server: "${this.backendURL}"`, 'warning', 4000 |
|
|
|
'Can`t connect to Hastic server', `Hastic server: "${this.backendURL}"`, 'warning', 4000 |
|
|
|
); |
|
|
|
); |
|
|
|
}
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
link(scope, elem, attrs, ctrl) { |
|
|
|
link(scope, elem, attrs, ctrl) { |
|
|
|