Commit ae2a3ee8 by Rashid Khan

Fixed bug in where pie panel would not stringify correctly if mode was changed

parent 632b2abb
......@@ -13,7 +13,7 @@ If you need to configure the default dashboard, please see dashboard.js
*/
var config = new Settings(
{
elasticsearch: 'http://localhost:9200',
elasticsearch: 'http://localhost:9201',
timeformat: 'mm/dd HH:MM:ss',
modules: ['histogram','map','pie','table','stringquery','sort',
'timepicker','text','fields','hits','dashcontrol'],
......
......@@ -97,6 +97,6 @@
</div>
<div class="span2">
<label class="small">Mode</label>
<select class="input-small" ng-model="panel.mode" ng-options="f for f in ['query','terms','goal']"></select>
<select class="input-small" ng-change="set_mode(panel.mode)" ng-model="panel.mode" ng-options="f for f in ['query','terms','goal']"></select>
</div>
</div>
\ No newline at end of file
......@@ -54,6 +54,21 @@ angular.module('kibana.pie', [])
$scope.get_data();
}
$scope.set_mode = function(mode) {
switch(mode)
{
case 'terms':
$scope.panel.query = {query:"*",field:"_all"};
break;
case 'query':
$scope.panel.query = [{query:"*",label:"*"}];
break;
case 'goal':
$scope.panel.query = {query:"*",goal:100};
break;
}
}
$scope.get_data = function() {
// Make sure we have everything for the request to complete
if(_.isUndefined($scope.panel.index) || _.isUndefined($scope.time))
......
......@@ -6,4 +6,10 @@
<label class="small">Multiquery Arrangement</label>
<select class="input-medium" ng-model="panel.multi_arrange" ng-options="f for f in ['vertical','horizontal']"></select>
</div>
<div class="span4" 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>
\ No newline at end of file
......@@ -21,9 +21,10 @@
</div>
</div>
<div class="row-fluid">
<div class="span4">
<div class="span4" style="white-space:nowrap">
<h5>Sort</h5>
<select style="width:85%" ng-model="panel.sort[0]" ng-options="f for f in all_fields"></select>
<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 class="span1">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment