mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(elasticsearch): add pipeline settings
This commit is contained in:
parent
2d2ad8b237
commit
85094fc74d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user