diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index bf2dce5..84680fb 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -629,7 +629,22 @@ class GraphCtrl extends MetricsPanelCtrl { this.analyticsController.redetectAll(from, to); } - async runDetectInCurrentRange(analyticUnit: AnalyticUnit) { + async runDetectInCurrentRange(analyticUnit: AnalyticUnit): Promise { + if(analyticUnit.status === 'LEARNING') { + let modalScope = this.$scope.$new(true); + modalScope.confirm = async () => { + await this._runDetectInCurrentRange(analyticUnit); + }; + appEvents.emit('show-modal', { + src: `${this.partialsPath}/relearning_confirmation.html`, + scope: modalScope + }); + } else { + await this._runDetectInCurrentRange(analyticUnit); + } + } + + async _runDetectInCurrentRange(analyticUnit: AnalyticUnit): Promise { const { from, to } = this.rangeTimestamp; if(analyticUnit.changed) { diff --git a/src/panel/graph_panel/partials/analytic_units_5.x.html b/src/panel/graph_panel/partials/analytic_units_5.x.html index 54187ad..0034579 100644 --- a/src/panel/graph_panel/partials/analytic_units_5.x.html +++ b/src/panel/graph_panel/partials/analytic_units_5.x.html @@ -126,7 +126,7 @@