From 8ada2069270971dbf869ca32e458a9fdd0b177b7 Mon Sep 17 00:00:00 2001 From: amper43 Date: Thu, 27 Sep 2018 14:08:11 +0300 Subject: [PATCH] enable logging --- src/controllers/analytic_controller.ts | 18 +++++++++--------- src/partials/tab_analytics.html | 4 ++-- src/services/analytic_service.ts | 2 ++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/controllers/analytic_controller.ts b/src/controllers/analytic_controller.ts index 7e9272c..92cecc7 100644 --- a/src/controllers/analytic_controller.ts +++ b/src/controllers/analytic_controller.ts @@ -49,7 +49,7 @@ export class AnalyticController { this._labelingDataAddedSegments = new SegmentArray(); this._labelingDataDeletedSegments = new SegmentArray(); this._analyticUnitsSet = new AnalyticUnitsSet(this._panelObject.anomalyTypes); - // this.analyticUnits.forEach(a => this.runEnabledWaiter(a)); + this.analyticUnits.forEach(a => this.runEnabledWaiter(a)); } getSegmentsSearcher(): AnalyticSegmentsSearcher { @@ -88,7 +88,7 @@ export class AnalyticController { this._analyticUnitsSet.addItem(this._newAnalyticUnit); this._creatingNewAnalyticType = false; this._savingNewAnalyticUnit = false; - // this.runEnabledWaiter(this._newAnalyticUnit); + this.runEnabledWaiter(this._newAnalyticUnit); this._runStatusWaiter(this._newAnalyticUnit); } @@ -358,13 +358,13 @@ export class AnalyticController { this._statusRunners.delete(analyticUnit.id); } - // async runEnabledWaiter(analyticUnit: AnalyticUnit) { - // var enabled = await this._analyticService.getAlertEnabled(analyticUnit.id); - // if(analyticUnit.alertEnabled !== enabled) { - // analyticUnit.alertEnabled = enabled; - // this._emitter.emit('anomaly-type-alert-change', analyticUnit); - // } - // } + async runEnabledWaiter(analyticUnit: AnalyticUnit) { + var enabled = await this._analyticService.getAlertEnabled(analyticUnit.id); + if(analyticUnit.alertEnabled !== enabled) { + analyticUnit.alertEnabled = enabled; + this._emitter.emit('anomaly-type-alert-change', analyticUnit); + } + } async toggleAlertEnabled(analyticUnit: AnalyticUnit) { var enabled = analyticUnit.alertEnabled; diff --git a/src/partials/tab_analytics.html b/src/partials/tab_analytics.html index 69ebff7..e0728e6 100644 --- a/src/partials/tab_analytics.html +++ b/src/partials/tab_analytics.html @@ -49,7 +49,7 @@ - +