|
|
@ -47,6 +47,7 @@ export class AnalyticController { |
|
|
|
private _currentMetric: MetricExpanded; |
|
|
|
private _currentMetric: MetricExpanded; |
|
|
|
private _currentDatasource: DatasourceRequest; |
|
|
|
private _currentDatasource: DatasourceRequest; |
|
|
|
private _thresholds: Threshold[]; |
|
|
|
private _thresholds: Threshold[]; |
|
|
|
|
|
|
|
private _loading = true; |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private _grafanaUrl: string, |
|
|
|
private _grafanaUrl: string, |
|
|
@ -65,6 +66,10 @@ export class AnalyticController { |
|
|
|
|
|
|
|
|
|
|
|
get helpSectionText() { return text; } |
|
|
|
get helpSectionText() { return text; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get loading() { |
|
|
|
|
|
|
|
return this._loading; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getSegmentsSearcher(): AnalyticSegmentsSearcher { |
|
|
|
getSegmentsSearcher(): AnalyticSegmentsSearcher { |
|
|
|
return this._segmentsSearcher.bind(this); |
|
|
|
return this._segmentsSearcher.bind(this); |
|
|
|
} |
|
|
|
} |
|
|
@ -229,7 +234,7 @@ export class AnalyticController { |
|
|
|
if(!_.isNumber(+to)) { |
|
|
|
if(!_.isNumber(+to)) { |
|
|
|
throw new Error('to isn`t number'); |
|
|
|
throw new Error('to isn`t number'); |
|
|
|
} |
|
|
|
} |
|
|
|
var tasks = this.analyticUnits.map(a => this.fetchSegments(a, from, to)); |
|
|
|
const tasks = this.analyticUnits.map(a => this.fetchSegments(a, from, to)); |
|
|
|
return Promise.all(tasks); |
|
|
|
return Promise.all(tasks); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -286,7 +291,7 @@ export class AnalyticController { |
|
|
|
options.markings = []; |
|
|
|
options.markings = []; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for(var i = 0; i < this.analyticUnits.length; i++) { |
|
|
|
for(let i = 0; i < this.analyticUnits.length; i++) { |
|
|
|
const analyticUnit = this.analyticUnits[i]; |
|
|
|
const analyticUnit = this.analyticUnits[i]; |
|
|
|
if(!analyticUnit.visible) { |
|
|
|
if(!analyticUnit.visible) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
@ -401,6 +406,8 @@ export class AnalyticController { |
|
|
|
async fetchAnalyticUnits(): Promise<void> { |
|
|
|
async fetchAnalyticUnits(): Promise<void> { |
|
|
|
const units = await this.getAnalyticUnits(); |
|
|
|
const units = await this.getAnalyticUnits(); |
|
|
|
this._analyticUnitsSet = new AnalyticUnitsSet(units); |
|
|
|
this._analyticUnitsSet = new AnalyticUnitsSet(units); |
|
|
|
|
|
|
|
this._loading = false; |
|
|
|
|
|
|
|
this.fetchAnalyticUnitsStatuses(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async updateThresholds(): Promise<void> { |
|
|
|
async updateThresholds(): Promise<void> { |
|
|
|