|
|
@ -59,8 +59,8 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
private _panelId: string; |
|
|
|
private _panelId: string; |
|
|
|
|
|
|
|
|
|
|
|
private _dataTimerange: { |
|
|
|
private _dataTimerange: { |
|
|
|
from: number, |
|
|
|
from?: number, |
|
|
|
to: number |
|
|
|
to?: number |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
panelDefaults = { |
|
|
|
panelDefaults = { |
|
|
@ -273,10 +273,8 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
await this.analyticsController.removeAnalyticUnit(analyticUnit.id, true); |
|
|
|
await this.analyticsController.removeAnalyticUnit(analyticUnit.id, true); |
|
|
|
} |
|
|
|
} |
|
|
|
if(analyticUnit.status === 'READY') { |
|
|
|
if(analyticUnit.status === 'READY') { |
|
|
|
if(this.range === undefined) { |
|
|
|
const { from, to } = this.rangeTimestamp; |
|
|
|
this.updateTimeRange(); |
|
|
|
await this.analyticsController.fetchSegments(analyticUnit, from, to); |
|
|
|
} |
|
|
|
|
|
|
|
await this.analyticsController.fetchSegments(analyticUnit, +this.range.from, +this.range.to); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.render(this.seriesList); |
|
|
|
this.render(this.seriesList); |
|
|
|
this.$scope.$digest(); |
|
|
|
this.$scope.$digest(); |
|
|
@ -372,8 +370,7 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
this.dataList = dataList; |
|
|
|
this.dataList = dataList; |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
|
|
|
|
const from = +this.range.from; |
|
|
|
const { from, to } = this.rangeTimestamp; |
|
|
|
const to = +this.range.to; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.analyticsController !== undefined) { |
|
|
|
if(this.analyticsController !== undefined) { |
|
|
|
const hsrSeries = await this.analyticsController.getHSRSeries(from, to); |
|
|
|
const hsrSeries = await this.analyticsController.getHSRSeries(from, to); |
|
|
@ -432,10 +429,9 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
const from = _.find(series.datapoints, datapoint => datapoint[0] !== null); |
|
|
|
const from = _.find(series.datapoints, datapoint => datapoint[0] !== null); |
|
|
|
const to = _.findLast(series.datapoints, datapoint => datapoint[0] !== null); |
|
|
|
const to = _.findLast(series.datapoints, datapoint => datapoint[0] !== null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this._dataTimerange = {}; |
|
|
|
if(from !== undefined && to !== undefined) { |
|
|
|
if(from !== undefined && to !== undefined) { |
|
|
|
this._dataTimerange = { from: from[1], to: to[1] }; |
|
|
|
this._dataTimerange = { from: from[1], to: to[1] }; |
|
|
|
} else { |
|
|
|
|
|
|
|
this._dataTimerange = { from: null, to: null } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (series.unit) { |
|
|
|
if (series.unit) { |
|
|
@ -580,8 +576,13 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
this.analyticsController.redetectAll(); |
|
|
|
this.analyticsController.redetectAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async runDetect(analyticUnitId: AnalyticUnitId) { |
|
|
|
async runDetectInCurrentRange(analyticUnitId: AnalyticUnitId) { |
|
|
|
this.analyticsController.runDetect(analyticUnitId); |
|
|
|
const { from, to } = this.rangeTimestamp; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.analyticsController.runDetect( |
|
|
|
|
|
|
|
analyticUnitId, |
|
|
|
|
|
|
|
from, to |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async saveNew() { |
|
|
|
async saveNew() { |
|
|
@ -734,6 +735,17 @@ class GraphCtrl extends MetricsPanelCtrl { |
|
|
|
this.$scope.$digest(); |
|
|
|
this.$scope.$digest(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
get rangeTimestamp(): { from: number, to: number } { |
|
|
|
|
|
|
|
if(this.range === undefined) { |
|
|
|
|
|
|
|
this.updateTimeRange(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
from: +this.range.from, |
|
|
|
|
|
|
|
to: +this.range.to |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
get hasticDatasources() { |
|
|
|
get hasticDatasources() { |
|
|
|
return this._hasticDatasources; |
|
|
|
return this._hasticDatasources; |
|
|
|
} |
|
|
|
} |
|
|
|