From 7b5c1a676158b298224685a2f1cf8ba45450d58c Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Mon, 25 Feb 2013 09:32:54 -0700 Subject: [PATCH] Fixed bugs in multiquery receive --- panels/stringquery/editor.html | 32 ++++++++++++++++---------- panels/stringquery/module.html | 42 ++++++++++++++++++++++++++-------- panels/stringquery/module.js | 14 ++++++++++++ panels/table/module.js | 2 +- 4 files changed, 67 insertions(+), 23 deletions(-) diff --git a/panels/stringquery/editor.html b/panels/stringquery/editor.html index 6a505dfb340..a381af3037b 100644 --- a/panels/stringquery/editor.html +++ b/panels/stringquery/editor.html @@ -1,15 +1,23 @@ -
-
- +
+
+
+ +
+
+ + +
+
+ + + + +
-
- - -
-
- - - - +
+
+
A note on multi query panels
+

You turned on multi panel support: cool. Be aware that not all panels support display of multiple queries. Panels that don't support receiving several queries at one time will (should) display the results of the first query in the list. Further, some panels might not support receiving multiple queries in all modes. For example, the pie panel supports multiple queries only in query mode. In its other modes it will display the results of the first query in the list

+
\ No newline at end of file diff --git a/panels/stringquery/module.html b/panels/stringquery/module.html index d6d88242d38..1a162318560 100644 --- a/panels/stringquery/module.html +++ b/panels/stringquery/module.html @@ -1,24 +1,46 @@
-
- - - - - -
+ + + + + + + + +
+ + + + + + + +
-
+
- +
-

+
+
+
+ + + + + + +
+ + +
\ No newline at end of file diff --git a/panels/stringquery/module.js b/panels/stringquery/module.js index 76de35ffe0f..48f67673e9a 100644 --- a/panels/stringquery/module.js +++ b/panels/stringquery/module.js @@ -17,7 +17,14 @@ angular.module('kibana.stringquery', []) $scope.panel.group : [$scope.panel.group]; $scope.init = function() { + + // I don't like this compromise. I'm not totally sure what this panel + // Should do if its in multi query mode and receives a query. For now, just + // replace the first one, though I feel like that isn't right. eventBus.register($scope,'query',function(event,query) { + if (_.isArray($scope.panel.query)) + $scope.panel.query[0] = query + else $scope.panel.query = query; }); } @@ -40,6 +47,13 @@ angular.module('kibana.stringquery', []) new Array($scope.panel.query) : $scope.panel.query[0]; } + $scope.set_sort = function(field) { + if($scope.panel.sort[0] === field) + $scope.panel.sort[1] = $scope.panel.sort[1] == 'asc' ? 'desc' : 'asc'; + else + $scope.panel.sort[0] = field; + } + $scope.remove_query = function(index) { $scope.panel.query.splice(index,1); console.log($scope.panel.query) diff --git a/panels/table/module.js b/panels/table/module.js index 25b33ee29e1..2863f2aa90f 100644 --- a/panels/table/module.js +++ b/panels/table/module.js @@ -52,7 +52,7 @@ angular.module('kibana.table', []) $scope.panel.fields = _.without($scope.panel.fields,field) else $scope.panel.fields.push(field) - broadcast_fields(); + broadcast_results(); } $scope.toggle_details = function(row) {