mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 23:37:01 -06:00
Merge branch 'master' of https://github.com/mxk1235/grafana into mxk1235-master
This commit is contained in:
commit
0e0caabf7d
@ -175,6 +175,16 @@ function (angular, _, dateMath) {
|
||||
});
|
||||
};
|
||||
|
||||
OpenTSDBDatasource.prototype.performAggregatorsQuery = function() {
|
||||
return this._get('/api/aggregators', {}).then(function(result) {
|
||||
if (result.data instanceof Array) {
|
||||
return result.data.sort();
|
||||
} else {
|
||||
return result.data;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function transformMetricData(md, groupByTags, target, options) {
|
||||
var metricLabel = createMetricLabel(md, target, groupByTags, options);
|
||||
var dps = [];
|
||||
|
@ -14,6 +14,12 @@ function (angular, _, kbn) {
|
||||
$scope.target.errors = validateTarget($scope.target);
|
||||
$scope.aggregators = ['avg', 'sum', 'min', 'max', 'dev', 'zimsum', 'mimmin', 'mimmax'];
|
||||
|
||||
$scope.datasource.performAggregatorsQuery().then(function(result) {
|
||||
if (result) {
|
||||
$scope.aggregators = result;
|
||||
}
|
||||
});
|
||||
|
||||
if (!$scope.target.aggregator) {
|
||||
$scope.target.aggregator = 'sum';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user