Commit 85094fc7 by Carl Bergquist

feat(elasticsearch): add pipeline settings

parent 2d2ad8b2
......@@ -13,12 +13,15 @@ function (angular, _, queryDef) {
$scope.metricAggTypes = queryDef.metricAggTypes;
$scope.extendedStats = queryDef.extendedStats;
$scope.pipelineSettings = [];
$scope.pipelineAggOptions = [];
$scope.init = function() {
$scope.agg = metricAggs[$scope.index];
$scope.validateModel();
$scope.updatePipelineAggOptions();
$scope.pipelineSettings = queryDef.getPipelineSettings($scope.agg);
};
$scope.updatePipelineAggOptions = function() {
......
......@@ -45,6 +45,19 @@
</ul>
<div class="clearfix"></div>
</div>
<div ng-if="agg.pipelineAgg !== undefined">
<div class="tight-form" ng-repeat="setting in agg.pipelineSettings">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 100px">
{{stat.text}}
</li>
<li class="tight-form-item last">
<editor-checkbox text="" model="agg.meta.{{stat.value}}" change="onChange()"></editor-checkbox>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<div class="tight-form last" ng-if="agg.type === 'percentiles'">
<ul class="tight-form-list">
<li class="tight-form-item">
......
......@@ -70,6 +70,19 @@ function (_) {
pipelineAggs: ['moving_avg', 'derivative'],
pipelineSettings: {
'moving_avg' : ['model', 'gap_policy', 'window', 'minimize'],
'derivative': []
},
getPipelineSettings: function(metric) {
if (this.isPipelineAgg(metric) === false) {
return [];
}
return this.pipelineSettings[metric.type];
},
isPipelineAgg: function(metric) {
if (metric.type) {
return this.pipelineAggs.indexOf(metric.type) > -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment