Added global field list service for use in panel editor type ahead
This commit is contained in:
+5
-1
@@ -3,7 +3,7 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('kibana.controllers', [])
|
||||
.controller('DashCtrl', function($scope, $rootScope, $http, $timeout, ejsResource, eventBus) {
|
||||
.controller('DashCtrl', function($scope, $rootScope, $http, $timeout, ejsResource, eventBus, fields) {
|
||||
|
||||
var _d = {
|
||||
title: "",
|
||||
@@ -14,7 +14,11 @@ angular.module('kibana.controllers', [])
|
||||
$scope.init = function() {
|
||||
|
||||
$scope.config = config;
|
||||
// Make underscore.js available to views
|
||||
$scope._ = _;
|
||||
|
||||
// Provide a global list of all see fields
|
||||
$scope.fields = fields
|
||||
$scope.reset_row();
|
||||
$scope.clear_all_alerts();
|
||||
|
||||
|
||||
@@ -67,6 +67,21 @@ angular.module('kibana.services', [])
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
/* Service: fields
|
||||
Provides a global list of all seen fields for use in editor panels
|
||||
*/
|
||||
.factory('fields', function($rootScope) {
|
||||
var fields = {
|
||||
list : []
|
||||
}
|
||||
|
||||
$rootScope.$on('fields', function(event,f) {
|
||||
fields.list = _.union(f.data.all,fields.list)
|
||||
})
|
||||
|
||||
return fields;
|
||||
|
||||
})
|
||||
.service('timer', function($timeout) {
|
||||
// This service really just tracks a list of $timeout promises to give us a
|
||||
|
||||
Reference in New Issue
Block a user