Add templated items and apps search.
This commit is contained in:
@@ -8,7 +8,7 @@ function (angular, _) {
|
||||
var module = angular.module('grafana.controllers');
|
||||
var targetLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
|
||||
module.controller('ZabbixAPIQueryCtrl', function($scope) {
|
||||
module.controller('ZabbixAPIQueryCtrl', function($scope, $sce, templateSrv) {
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.targetLetters = targetLetters;
|
||||
@@ -162,6 +162,14 @@ function (angular, _) {
|
||||
$scope.datasource.performHostSuggestQuery(groupid).then(function (series) {
|
||||
$scope.metric.hostList = series;
|
||||
|
||||
// Add templated variables
|
||||
_.each(templateSrv.variables, function(variable) {
|
||||
$scope.metric.hostList.push({
|
||||
'name': '$' + variable.name,
|
||||
'hostid': 0
|
||||
})
|
||||
});
|
||||
|
||||
if ($scope.target.host) {
|
||||
$scope.target.host = $scope.metric.hostList.filter(function (item, index, array) {
|
||||
// Find selected host in metric.hostList
|
||||
|
||||
Reference in New Issue
Block a user