From e3e4516096a47777564a675e2462ca05b46bf669 Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Tue, 10 Jul 2018 21:32:53 +0300 Subject: [PATCH] analytic type in form name vs value --- dist/module.js | 9 +++++++-- dist/partials/tab_analytics.html | 4 ++-- src/models/analytic_unit.ts | 3 ++- src/module.ts | 7 ++++++- src/partials/tab_analytics.html | 4 ++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dist/module.js b/dist/module.js index 989bb6f..f96a597 100644 --- a/dist/module.js +++ b/dist/module.js @@ -7644,7 +7644,7 @@ var AnalyticUnit = /** @class */ (function () { this._panelObject = {}; } lodash__WEBPACK_IMPORTED_MODULE_2___default.a.defaults(this._panelObject, { - name: 'AnalyticUnitName', confidence: 0.2, color: 'red', type: 'General' + name: 'AnalyticUnitName', confidence: 0.2, color: 'red', type: 'general' }); //this._metric = new Metric(_panelObject.metric); } @@ -8165,7 +8165,12 @@ var GraphCtrl = /** @class */ (function (_super) { _this.popoverSrv = popoverSrv; _this.contextSrv = contextSrv; _this.alertSrv = alertSrv; - _this.ANALYTIC_TYPES = ['General', 'Drops', 'Peaks']; + _this.ANALYTIC_TYPES = [ + { name: 'General', value: 'general' }, + { name: 'Peaks', value: 'peak' }, + { name: 'Jumps', value: 'jump' }, + { name: 'Drops', value: 'drop' } + ]; _this.hiddenSeries = {}; _this.seriesList = []; _this.dataList = []; diff --git a/dist/partials/tab_analytics.html b/dist/partials/tab_analytics.html index 7d7fc44..43bb260 100644 --- a/dist/partials/tab_analytics.html +++ b/dist/partials/tab_analytics.html @@ -13,7 +13,7 @@
diff --git a/src/models/analytic_unit.ts b/src/models/analytic_unit.ts index 4a66fd6..2a1bf07 100644 --- a/src/models/analytic_unit.ts +++ b/src/models/analytic_unit.ts @@ -5,6 +5,7 @@ import { Metric } from './metric'; import _ from 'lodash'; + export type AnalyticSegmentPair = { anomalyType: AnalyticUnit, segment: AnalyticSegment }; export type AnalyticSegmentsSearcher = (point: number, rangeDist: number) => AnalyticSegmentPair[]; @@ -36,7 +37,7 @@ export class AnalyticUnit { this._panelObject = {}; } _.defaults(this._panelObject, { - name: 'AnalyticUnitName', confidence: 0.2, color: 'red', type: 'General' + name: 'AnalyticUnitName', confidence: 0.2, color: 'red', type: 'general' }); //this._metric = new Metric(_panelObject.metric); diff --git a/src/module.ts b/src/module.ts index 5667aa2..0cf174e 100644 --- a/src/module.ts +++ b/src/module.ts @@ -26,7 +26,12 @@ const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL'; class GraphCtrl extends MetricsPanelCtrl { static template = template; - ANALYTIC_TYPES: Array = ['General', 'Drops', 'Peaks']; + ANALYTIC_TYPES: Array<{name: string, value: string}> = [ + { name: 'General', value: 'general' }, + { name: 'Peaks', value: 'peak' }, + { name: 'Jumps', value: 'jump' }, + { name: 'Drops', value: 'drop' } + ]; hiddenSeries: any = {}; seriesList: any = []; diff --git a/src/partials/tab_analytics.html b/src/partials/tab_analytics.html index 7d7fc44..43bb260 100644 --- a/src/partials/tab_analytics.html +++ b/src/partials/tab_analytics.html @@ -13,7 +13,7 @@