Browse Source

analytic type in form name vs value

master
Alexey Velikiy 7 years ago
parent
commit
e3e4516096
  1. 9
      dist/module.js
  2. 4
      dist/partials/tab_analytics.html
  3. 3
      src/models/analytic_unit.ts
  4. 7
      src/module.ts
  5. 4
      src/partials/tab_analytics.html

9
dist/module.js vendored

@ -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 = [];

4
dist/partials/tab_analytics.html vendored

@ -13,7 +13,7 @@
<div class="gf-form-select-wrapper">
<select class="gf-form-input width-12"
ng-model="analyticUnit.type"
ng-options="type as type for type in ctrl.ANALYTIC_TYPES"
ng-options="type.value as type.name for type in ctrl.ANALYTIC_TYPES"
ng-disabled="true"
/>
</div>
@ -127,7 +127,7 @@
<div class="gf-form-select-wrapper">
<select class="gf-form-input width-12"
ng-model="ctrl.analyticsController.newAnalyticUnit.type"
ng-options="type as type for type in ctrl.ANALYTIC_TYPES"
ng-options="type.value as type.name for type in ctrl.ANALYTIC_TYPES"
/>
</div>

3
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);

7
src/module.ts

@ -26,7 +26,12 @@ const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL';
class GraphCtrl extends MetricsPanelCtrl {
static template = template;
ANALYTIC_TYPES: Array<String> = ['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 = [];

4
src/partials/tab_analytics.html

@ -13,7 +13,7 @@
<div class="gf-form-select-wrapper">
<select class="gf-form-input width-12"
ng-model="analyticUnit.type"
ng-options="type as type for type in ctrl.ANALYTIC_TYPES"
ng-options="type.value as type.name for type in ctrl.ANALYTIC_TYPES"
ng-disabled="true"
/>
</div>
@ -127,7 +127,7 @@
<div class="gf-form-select-wrapper">
<select class="gf-form-input width-12"
ng-model="ctrl.analyticsController.newAnalyticUnit.type"
ng-options="type as type for type in ctrl.ANALYTIC_TYPES"
ng-options="type.value as type.name for type in ctrl.ANALYTIC_TYPES"
/>
</div>

Loading…
Cancel
Save