Browse Source

Move analytic unit types to panel.json (#60)

master
sanke1 6 years ago committed by rozetko
parent
commit
b05fb676b7
  1. 16
      src/module.ts
  2. 4
      src/partials/tab_analytics.html

16
src/module.ts

@ -26,14 +26,6 @@ const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL';
class GraphCtrl extends MetricsPanelCtrl {
static template = template;
ANALYTIC_TYPES: Array<{name: string, value: string}> = [
{ name: 'General', value: 'GENERAL' },
{ name: 'Peaks', value: 'PEAK' },
{ name: 'Troughs', value: 'TROUGH' },
{ name: 'Jumps', value: 'JUMP' },
{ name: 'Drops', value: 'DROP' },
{ name: 'Custom', value: 'CUSTOM' }
];
hiddenSeries: any = {};
seriesList: any = [];
@ -141,6 +133,14 @@ class GraphCtrl extends MetricsPanelCtrl {
seriesOverrides: [],
thresholds: [],
anomalyType: '',
analyticUnitTypes: [
{ name: 'General', value: 'GENERAL' },
{ name: 'Peaks', value: 'PEAK' },
{ name: 'Troughs', value: 'TROUGH' },
{ name: 'Jumps', value: 'JUMP' },
{ name: 'Drops', value: 'DROP' },
{ name: 'Custom', value: 'CUSTOM' }
]
};
/** @ngInject */

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.value as type.name for type in ctrl.ANALYTIC_TYPES"
ng-options="type.value as type.name for type in ctrl.panel.analyticUnitTypes"
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.value as type.name for type in ctrl.ANALYTIC_TYPES"
ng-options="type.value as type.name for type in ctrl.panel.analyticUnitTypes"
/>
</div>

Loading…
Cancel
Save