Commit 0d8f1fab by Rashid Khan

fixed histogram and pie editors, added hits and map editors

parent b94ea26b
...@@ -193,8 +193,8 @@ var dashboards = ...@@ -193,8 +193,8 @@ var dashboards =
labels : false, labels : false,
colors : ['#BF3030','#1D7373','#86B32D','#A60000','#006363','#679B00'], colors : ['#BF3030','#1D7373','#86B32D','#A60000','#006363','#679B00'],
field : 'country', field : 'country',
mode : "query", mode : "terms",
query : { query:"falstaff" } query : { query:"*", field:"play_name" }
}, },
{ {
type : "text", type : "text",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</form> </form>
</div> </div>
<div class="span1"> <div class="span1">
<i class="icon-remove" ng-click="remove_query(q);get_data()"></i> <i class="icon-remove pointer" ng-click="remove_query(q)"></i>
</div> </div>
</div> </div>
<div class="row-fluid"> <div class="row-fluid">
......
...@@ -25,6 +25,7 @@ angular.module('kibana.histogram', []) ...@@ -25,6 +25,7 @@ angular.module('kibana.histogram', [])
$scope.remove_query = function(q) { $scope.remove_query = function(q) {
$scope.panel.query = _.without($scope.panel.query,q); $scope.panel.query = _.without($scope.panel.query,q);
$scope.get_data();
} }
$scope.add_query = function(label,query) { $scope.add_query = function(label,query) {
......
<div class="row-fluid">
<div class="span9">
<form class="input-append">
<h6>Query</h6>
<input type="text" style="width:85%" ng-model="panel.query">
<button class="btn" ng-click="get_data();"><i class="icon-search"></i></button>
</form>
</div>
<div class="span3"><h6>Font Size</h6>
<select class="input-small" ng-model="panel.style['font-size']" ng-options="f for f in ['6pt','7pt','8pt','10pt','12pt','14pt','16pt','18pt','20pt','24pt','28pt','32pt','36pt','42pt','48pt','52pt','60pt','72pt']"></select></span>
</div>
<div class="row-fluid">
<div class="span9">
<form class="input-append">
<h6>Query</h6>
<input type="text" style="width:85%" ng-model="panel.query">
<button class="btn" ng-click="get_data();"><i class="icon-search"></i></button>
</form>
</div>
<div class="span3"><h6>Map</h6>
<select class="input-small" ng-model="panel.map" ng-options="f for f in ['world','europe','usa']"></select></span>
</div>
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
</div> </div>
<div ng-switch-when="query"> <div ng-switch-when="query">
<div class="row-fluid"> <div class="row-fluid">
<div class="span1">
</div>
<div class="span3"> <div class="span3">
<form style="margin-bottom: 0px"> <form style="margin-bottom: 0px">
<h6>Label</h6> <h6>Label</h6>
...@@ -46,12 +44,11 @@ ...@@ -46,12 +44,11 @@
<button class="btn" ng-click="add_query(newlabel,newquery);newlabel='';newquery=''"><i class="icon-plus"></i></button> <button class="btn" ng-click="add_query(newlabel,newquery);newlabel='';newquery=''"><i class="icon-plus"></i></button>
</form> </form>
</div> </div>
<div class="span1">
</div>
</div> </div>
<div class="row-fluid" ng-repeat="q in panel.query"> <div class="row-fluid" ng-repeat="q in panel.query">
<div class="span1"> <div class="span3">
<i class="icon-remove" ng-click="remove_query(q)"></i>
</div>
<div class="span4">
<form style="margin-bottom: 0px"> <form style="margin-bottom: 0px">
<input type="text" style="width:70%" ng-model="q.label"> <input type="text" style="width:70%" ng-model="q.label">
</form> </form>
...@@ -62,6 +59,9 @@ ...@@ -62,6 +59,9 @@
<button class="btn" ng-click="get_data()"><i class="icon-search"></i></button> <button class="btn" ng-click="get_data()"><i class="icon-search"></i></button>
</form> </form>
</div> </div>
<div class="span1">
<i class="icon-remove pointer" ng-click="remove_query(q)"></i>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -33,6 +33,14 @@ angular.module('kibana.pie', []) ...@@ -33,6 +33,14 @@ angular.module('kibana.pie', [])
eventBus.broadcast($scope.$id,$scope.panel.group,'get_time') eventBus.broadcast($scope.$id,$scope.panel.group,'get_time')
} }
$scope.remove_query = function(q) {
if($scope.panel.mode !== 'query')
return false;
$scope.panel.query = _.without($scope.panel.query,q);
$scope.get_data();
}
$scope.add_query = function(label,query) { $scope.add_query = function(label,query) {
if($scope.panel.mode !== 'query') if($scope.panel.mode !== 'query')
return false; return false;
......
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