mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graphite 1.0 functions (#8987)
* graphite-ds: add graphite version to config editor * graphite-ds: modify add-graphite-function to show only version-related functions * graphite-ds: refactor, move func filtering to gfunc.js * graphite-ds: add new functions for graphite 1.0.x * graphite-ds: fix unit tests (add jsonData)
This commit is contained in:
committed by
Torkel Ödegaard
parent
35522c475f
commit
4fe79edd40
@@ -20,9 +20,10 @@ function (angular, _, $, gfunc) {
|
||||
|
||||
return {
|
||||
link: function($scope, elem) {
|
||||
var categories = gfunc.getCategories();
|
||||
var allFunctions = getAllFunctionNames(categories);
|
||||
var ctrl = $scope.ctrl;
|
||||
var graphiteVersion = ctrl.datasource.graphiteVersion;
|
||||
var categories = gfunc.getCategories(graphiteVersion);
|
||||
var allFunctions = getAllFunctionNames(categories);
|
||||
|
||||
$scope.functionMenu = createFunctionDropDownMenu(categories);
|
||||
|
||||
@@ -94,14 +95,16 @@ function (angular, _, $, gfunc) {
|
||||
|
||||
function createFunctionDropDownMenu(categories) {
|
||||
return _.map(categories, function(list, category) {
|
||||
var submenu = _.map(list, function(value) {
|
||||
return {
|
||||
text: value.name,
|
||||
click: "ctrl.addFunction('" + value.name + "')",
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
text: category,
|
||||
submenu: _.map(list, function(value) {
|
||||
return {
|
||||
text: value.name,
|
||||
click: "ctrl.addFunction('" + value.name + "')",
|
||||
};
|
||||
})
|
||||
submenu: submenu
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user