query panel documentation

This commit is contained in:
Rashid Khan 2013-04-19 21:46:47 -07:00
parent db524af6b2
commit 433272b994
2 changed files with 10 additions and 27 deletions

View File

@ -7,13 +7,6 @@
<label class="small">Arrangement</label>
<select class="input-small" ng-model="panel.multi_arrange" ng-options="f for f in ['vertical','horizontal']"></select>
</div>
<div class="span3" style="white-space:nowrap">
<label class="small">Sort</label>
<input ng-show="all_fields.length<=0 || !all_fields"style="width:85%" ng-model="panel.sort[0]" type="text"></input>
<select ng-show="all_fields.length>0"style="width:85%" ng-model="panel.sort[0]" ng-options="f for f in all_fields"></select>
<i ng-click="set_sort(panel.sort[0])" ng-class="{'icon-chevron-up': panel.sort[1] == 'asc','icon-chevron-down': panel.sort[1] == 'desc'}"></i>
</div>
<div>
</div>
<div class="row-fluid" ng-show="panel.multi">
<div class="span12">

View File

@ -1,22 +1,21 @@
/*
## Sort
## Stringquery
This will probably be removed in the near future since it only interacts with
the table panel and the table panel already implements all of its functionality.
It only interacts with the table panel in any case
Broadcasts a query object to other panels
### Parameters
* label :: The label to stick over the drop down
* sort :: An array where the first elemetn is the field to sort on an the second
is the direction ('asc' or 'desc')
* label :: The label to stick over the field
* 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
* sort :: An array where the first elemetn is the field to sort on an the second
is the direction ('asc' or 'desc')
* query :: Always broadcast as an array, even in multi: false
#### Receives
* fields :: An array containing the fields in a table. This will be concat'd +
uniqued with the curent list.
* query :: An array of queries. This is probably needs to be fixed.
*/
@ -27,8 +26,6 @@ angular.module('kibana.stringquery', [])
var _d = {
label : "Search",
query : "*",
size : 100,
sort : ['_score','desc'],
group : "default",
multi : false,
multi_arrange: 'horizontal',
@ -63,13 +60,6 @@ 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);
}