diff --git a/config.js b/config.js index b21d5407cfa..6eb756a0078 100644 --- a/config.js +++ b/config.js @@ -20,7 +20,7 @@ var config = new Settings( elasticsearch: "http://"+window.location.hostname+":9200", // elasticsearch: 'http://localhost:9200', kibana_index: "kibana-int", - modules: ['histogram','map','pie','table','stringquery','sort', + modules: ['histogram','map','pie','table' 'timepicker','text','fields','hits','dashcontrol', 'column','derivequeries','trends','bettermap','query'], } diff --git a/panels/bettermap/module.js b/panels/bettermap/module.js index c8f4a512a6d..bb2da6b460d 100644 --- a/panels/bettermap/module.js +++ b/panels/bettermap/module.js @@ -15,7 +15,7 @@ */ angular.module('kibana.bettermap', []) -.controller('bettermap', function($scope, eventBus, query, dashboard, filterSrv) { +.controller('bettermap', function($scope, query, dashboard, filterSrv) { // Set and populate defaults var _d = { diff --git a/panels/dashcontrol/module.js b/panels/dashcontrol/module.js index 853e13af0be..27a00032796 100644 --- a/panels/dashcontrol/module.js +++ b/panels/dashcontrol/module.js @@ -27,7 +27,7 @@ */ angular.module('kibana.dashcontrol', []) -.controller('dashcontrol', function($scope, $routeParams, $http, eventBus, timer, dashboard) { +.controller('dashcontrol', function($scope, $routeParams, $http, timer, dashboard) { $scope.panel = $scope.panel || {}; // Set and populate defaults @@ -150,7 +150,7 @@ angular.module('kibana.dashcontrol', []) }) } }) -.directive('dashUpload', function(timer, eventBus, dashboard){ +.directive('dashUpload', function(timer, dashboard){ return { restrict: 'A', link: function(scope, elem, attrs) { diff --git a/panels/derivequeries/module.js b/panels/derivequeries/module.js index 0d3762d73cb..3b92e4ff76f 100644 --- a/panels/derivequeries/module.js +++ b/panels/derivequeries/module.js @@ -11,19 +11,11 @@ * size :: how many queries to generate * fields :: a list of fields known to us * query_mode :: how to create query - - ### Group Events - #### Sends - * query :: Always broadcast as an array, even in multi: false - * get_time :: Request the time object from the timepicker - #### Receives - * query :: An array of queries. This is probably needs to be fixed. - * time :: populate index and time - * fields :: A list of fields known to us + */ angular.module('kibana.derivequeries', []) -.controller('derivequeries', function($scope, $rootScope, query, eventBus, fields, dashboard, filterSrv) { +.controller('derivequeries', function($scope, $rootScope, query, fields, dashboard, filterSrv) { // Set and populate defaults var _d = { diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 539892f223f..aee6a296738 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -226,6 +226,7 @@ angular.module('kibana.histogram', []) to:moment.utc(_to), field:$scope.panel.time_field }) + dashboard.refresh(); } diff --git a/panels/hits/module.js b/panels/hits/module.js index f6bc705f496..e38f66223aa 100644 --- a/panels/hits/module.js +++ b/panels/hits/module.js @@ -13,16 +13,10 @@ * donut :: Only applies to 'pie' charts. Punches a hole in the chart for some reason * tilt :: Only 'pie' charts. Janky 3D effect. Looks terrible 90% of the time. * lables :: Only 'pie' charts. Labels on the pie? - ### Group Events - #### Sends - * get_time :: On panel initialization get time range to query - #### Receives - * time :: An object containing the time range to use and the index(es) to query - * query :: An Array of queries, even if its only one */ angular.module('kibana.hits', []) -.controller('hits', function($scope, eventBus, query, dashboard, filterSrv) { +.controller('hits', function($scope, query, dashboard, filterSrv) { // Set and populate defaults var _d = { @@ -142,7 +136,7 @@ angular.module('kibana.hits', []) $scope.get_data(); } -}).directive('hitsChart', function(eventBus, query) { +}).directive('hitsChart', function(query) { return { restrict: 'A', link: function(scope, elem, attrs, ctrl) { diff --git a/panels/map/module.js b/panels/map/module.js index bd10628452e..c90644a95be 100644 --- a/panels/map/module.js +++ b/panels/map/module.js @@ -19,16 +19,11 @@ * spyable :: Show the 'eye' icon that reveals the last ES query * index_limit :: This does nothing yet. Eventually will limit the query to the first N indices - ### Group Events - #### Sends - * get_time :: On panel initialization get time range to query - #### Receives - * time :: An object containing the time range to use and the index(es) to query - * query :: An Array of queries, this panel uses only the first one + */ angular.module('kibana.map', []) -.controller('map', function($scope, $rootScope, eventBus, query, dashboard, filterSrv) { +.controller('map', function($scope, $rootScope, query, dashboard, filterSrv) { // Set and populate defaults var _d = { diff --git a/panels/pie/module.js b/panels/pie/module.js index f07c1c4f16b..45b99d8c1e5 100644 --- a/panels/pie/module.js +++ b/panels/pie/module.js @@ -23,17 +23,10 @@ doesn't have a field * spyable :: Show the 'eye' icon that displays the last ES query for this panel - ### Group Events - #### Sends - * get_time :: On panel initialization get time range to query - #### Receives - * time :: An object containing the time range to use and the index(es) to query - * query :: An Array of queries, this panel will use the first in the array - */ angular.module('kibana.pie', []) -.controller('pie', function($scope, $rootScope, eventBus, query, dashboard, filterSrv) { +.controller('pie', function($scope, $rootScope, query, dashboard, filterSrv) { // Set and populate defaults var _d = { diff --git a/panels/query/module.js b/panels/query/module.js index 019ff8a2167..eee355b1def 100644 --- a/panels/query/module.js +++ b/panels/query/module.js @@ -9,18 +9,10 @@ * query :: A string or an array of querys. String if multi is off, array if it is on This should be fixed, it should always be an array even if its only one element - * multi :: Allow input of multiple queries? true/false - * multi_arrange :: How to arrange multu query string panels, 'vertical' or 'horizontal' - ### Group Events - #### Sends - * query :: Always broadcast as an array, even in multi: false - #### Receives - * query :: An array of queries. This is probably needs to be fixed. - */ angular.module('kibana.query', []) -.controller('query', function($scope, eventBus, query, $rootScope) { +.controller('query', function($scope, query, $rootScope) { // Set and populate defaults var _d = { diff --git a/panels/timepicker/module.js b/panels/timepicker/module.js index 7cdef446b6e..0bce82e4270 100644 --- a/panels/timepicker/module.js +++ b/panels/timepicker/module.js @@ -15,17 +15,10 @@ * enable :: true/false, enable auto refresh by default. Default: false * interval :: Seconds between auto refresh. Default: 30 * min :: The lowest interval a user may set - - ### Group Events - #### Sends - * time :: Object Includes from, to and index - #### Receives - * get_time :: Receives an object containing a $id, broadcasts back to it. - */ angular.module('kibana.timepicker', []) -.controller('timepicker', function($scope, $rootScope, eventBus, $timeout, timer, $http, dashboard, filterSrv) { +.controller('timepicker', function($scope, $rootScope, $timeout, timer, $http, dashboard, filterSrv) { // Set and populate defaults var _d = { @@ -228,7 +221,7 @@ angular.module('kibana.timepicker', []) return $scope.panel.filter_id; } - // Prefer to pass around Date() objects in the EventBus since interacting with + // Prefer to pass around Date() objects since interacting with // moment objects in libraries that are expecting Date()s can be tricky function compile_time(time) { time = _.clone(time) diff --git a/panels/trends/module.js b/panels/trends/module.js index 518146c152a..0b45dd8432d 100644 --- a/panels/trends/module.js +++ b/panels/trends/module.js @@ -19,7 +19,7 @@ */ angular.module('kibana.trends', []) -.controller('trends', function($scope, eventBus, kbnIndex, query, dashboard, filterSrv) { +.controller('trends', function($scope, kbnIndex, query, dashboard, filterSrv) { // Set and populate defaults var _d = { @@ -37,11 +37,7 @@ angular.module('kibana.trends', []) $scope.$on('refresh',function(){$scope.get_data()}) - eventBus.register($scope,'time', function(event,time){ - set_time(time) - }); - // Now that we're all setup, request the time from our group - eventBus.broadcast($scope.$id,$scope.panel.group,'get_time') + $scope.get_data(); } $scope.get_data = function(segment,query_id) { @@ -173,19 +169,6 @@ angular.module('kibana.trends', []) return x == 0 ? null : 100*(y-x)/x } - $scope.remove_query = function(q) { - $scope.panel.query = _.without($scope.panel.query,q); - $scope.get_data(); - } - - $scope.add_query = function(label,query) { - $scope.panel.query.unshift({ - query: query, - label: label, - }); - $scope.get_data(); - } - $scope.set_refresh = function (state) { $scope.refresh = state; } @@ -197,9 +180,4 @@ angular.module('kibana.trends', []) $scope.$emit('render'); } - function set_time(time) { - $scope.time = time; - $scope.get_data(); - } - }) \ No newline at end of file