diff --git a/panels/derivequeries/module.html b/panels/derivequeries/module.html index 7dc663bc914c9..523f1970c3868 100644 --- a/panels/derivequeries/module.html +++ b/panels/derivequeries/module.html @@ -11,7 +11,7 @@ - + diff --git a/panels/derivequeries/module.js b/panels/derivequeries/module.js index 5675fc0434932..c03ee03e8fedb 100644 --- a/panels/derivequeries/module.js +++ b/panels/derivequeries/module.js @@ -36,7 +36,9 @@ angular.module('kibana.derivequeries', []) spyable : true, size : 5, mode : 'terms only', - exclude : [] + exclude : [], + history : [], + remember: 10 // max: 100, angular strap can't take a variable for items param } _.defaults($scope.panel,_d); @@ -54,6 +56,7 @@ angular.module('kibana.derivequeries', []) } $scope.get_data = function() { + update_history($scope.panel.query); // Make sure we have everything for the request to complete if(_.isUndefined($scope.index) || _.isUndefined($scope.time)) return @@ -128,6 +131,15 @@ angular.module('kibana.derivequeries', []) eventBus.broadcast($scope.$id,$scope.panel.group,'query',_query) } - + var update_history = function(query) { + query = _.isArray(query) ? query : [query]; + if($scope.panel.remember > 0) { + $scope.panel.history = _.union(query.reverse(),$scope.panel.history) + var _length = $scope.panel.history.length + if(_length > $scope.panel.remember) { + $scope.panel.history = $scope.panel.history.slice(0,$scope.panel.remember) + } + } + } }); diff --git a/panels/stringquery/module.html b/panels/stringquery/module.html index 372d8c50ddc94..6028685401566 100644 --- a/panels/stringquery/module.html +++ b/panels/stringquery/module.html @@ -7,7 +7,7 @@ - + @@ -21,7 +21,7 @@ - +
@@ -37,7 +37,7 @@ - + diff --git a/panels/stringquery/module.js b/panels/stringquery/module.js index bdff85542b128..ea58f7ed34de0 100644 --- a/panels/stringquery/module.js +++ b/panels/stringquery/module.js @@ -30,21 +30,24 @@ angular.module('kibana.stringquery', []) group : "default", multi : false, multi_arrange: 'horizontal', + history : [], + remember: 10 // max: 100, angular strap can't take a variable for items param } _.defaults($scope.panel,_d); $scope.init = function() { - // If we're in multi query mode, they all get wiped out if we receive a // query. Query events must be exchanged as arrays. eventBus.register($scope,'query',function(event,query) { $scope.panel.query = query; + update_history(query); }); } $scope.send_query = function(query) { - var _query = _.isArray(query) ? query : [query] - eventBus.broadcast($scope.$id,$scope.panel.group,'query',_query) + var _query = _.isArray(query) ? query : [query]; + update_history(_query); + eventBus.broadcast($scope.$id,$scope.panel.group,'query',_query); } $scope.add_query = function() { @@ -65,4 +68,14 @@ angular.module('kibana.stringquery', []) $scope.panel.query.splice(index,1); } + var update_history = function(query) { + if($scope.panel.remember > 0) { + $scope.panel.history = _.union(query.reverse(),$scope.panel.history) + var _length = $scope.panel.history.length + if(_length > $scope.panel.remember) { + $scope.panel.history = $scope.panel.history.slice(0,$scope.panel.remember) + } + } + } + }); \ No newline at end of file diff --git a/panels/timepicker/editor.html b/panels/timepicker/editor.html index ba94ca759490a..a6ae2a1087928 100644 --- a/panels/timepicker/editor.html +++ b/panels/timepicker/editor.html @@ -44,7 +44,7 @@
Failover Index If index not found
Relative mode settings
-
+
Relative time options comma seperated