mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
query panel documentation
This commit is contained in:
parent
db524af6b2
commit
433272b994
@ -7,13 +7,6 @@
|
|||||||
<label class="small">Arrangement</label>
|
<label class="small">Arrangement</label>
|
||||||
<select class="input-small" ng-model="panel.multi_arrange" ng-options="f for f in ['vertical','horizontal']"></select>
|
<select class="input-small" ng-model="panel.multi_arrange" ng-options="f for f in ['vertical','horizontal']"></select>
|
||||||
</div>
|
</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>
|
||||||
<div class="row-fluid" ng-show="panel.multi">
|
<div class="row-fluid" ng-show="panel.multi">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
|
@ -1,22 +1,21 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
## Sort
|
## Stringquery
|
||||||
|
|
||||||
This will probably be removed in the near future since it only interacts with
|
Broadcasts a query object to other panels
|
||||||
the table panel and the table panel already implements all of its functionality.
|
|
||||||
It only interacts with the table panel in any case
|
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
* label :: The label to stick over the drop down
|
* label :: The label to stick over the field
|
||||||
* sort :: An array where the first elemetn is the field to sort on an the second
|
* query :: A string or an array of querys. String if multi is off, array if it is on
|
||||||
is the direction ('asc' or 'desc')
|
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
|
### Group Events
|
||||||
#### Sends
|
#### Sends
|
||||||
* sort :: An array where the first elemetn is the field to sort on an the second
|
* query :: Always broadcast as an array, even in multi: false
|
||||||
is the direction ('asc' or 'desc')
|
|
||||||
#### Receives
|
#### Receives
|
||||||
* fields :: An array containing the fields in a table. This will be concat'd +
|
* query :: An array of queries. This is probably needs to be fixed.
|
||||||
uniqued with the curent list.
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -27,8 +26,6 @@ angular.module('kibana.stringquery', [])
|
|||||||
var _d = {
|
var _d = {
|
||||||
label : "Search",
|
label : "Search",
|
||||||
query : "*",
|
query : "*",
|
||||||
size : 100,
|
|
||||||
sort : ['_score','desc'],
|
|
||||||
group : "default",
|
group : "default",
|
||||||
multi : false,
|
multi : false,
|
||||||
multi_arrange: 'horizontal',
|
multi_arrange: 'horizontal',
|
||||||
@ -63,13 +60,6 @@ angular.module('kibana.stringquery', [])
|
|||||||
new Array($scope.panel.query) : $scope.panel.query[0];
|
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.remove_query = function(index) {
|
||||||
$scope.panel.query.splice(index,1);
|
$scope.panel.query.splice(index,1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user