Commit 48ad884e by Rashid Khan

Added drilldown links to micropanel

parent 77ce7b91
...@@ -13,7 +13,7 @@ If you need to configure the default dashboard, please see dashboard.js ...@@ -13,7 +13,7 @@ If you need to configure the default dashboard, please see dashboard.js
*/ */
var config = new Settings( var config = new Settings(
{ {
elasticsearch: 'http://localhost:9200', elasticsearch: 'http://demo.logstash.net:9200',
timeformat: 'mm/dd HH:MM:ss', timeformat: 'mm/dd HH:MM:ss',
modules: ['histogram','map','pie','table','stringquery','sort', modules: ['histogram','map','pie','table','stringquery','sort',
'timepicker','text','fields','hits','dashcontrol'], 'timepicker','text','fields','hits','dashcontrol'],
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
], ],
"type": "text", "type": "text",
"title": "Welcome", "title": "Welcome",
"content": "Welcome to Kibana Dashboard, a technology preview of what's to come for Kibana, Logstash and Elasticsearch \n\nKibana dashboard is the easy way to share, build, use and extend interactive, real time dashboards and data analysis interfaces. \n\nReady to get started? \n\nLogstash users, click the 'Load' button to the right, paste this URL: https://gist.github.com/75428ef74f3b97f31af4 into the 'Gist' loader, click 'Get' and select the 'Logstash Dashboard' link that appears", "content": "Welcome to Kibana Dashboard, a technology preview of what's to come for Kibana, Logstash and Elasticsearch \n\nKibana dashboard is the easy way to share, build, use and extend interactive, real time dashboards and data analysis interfaces. \n\nReady to get started? \n\nLogstash users, click the 'Load' button to the right, paste this URL: https://gist.github.com/a84f6b8a31d1c4f0ef85 into the 'Gist' loader, click 'Get' and select the 'Logstash Dashboard' link that appears",
"style": { "style": {
"font-size": "14pt" "font-size": "14pt"
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<div class="navbar navbar-fixed-top"> <div class="navbar navbar-fixed-top">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container-fluid"> <div class="container-fluid">
<span class="brand"><small>Kibana Preview</small></span> <span class="brand"><small>Kibana 3 Preview</small></span>
<span class="brand">{{dashboards.title}}</span> <span class="brand">{{dashboards.title}}</span>
<div class="brand"><i class='icon-edit pointer' ng-show='dashboards.editable' bs-modal="'partials/dasheditor.html'"></i></div> <div class="brand"><i class='icon-edit pointer' ng-show='dashboards.editable' bs-modal="'partials/dasheditor.html'"></i></div>
</div> </div>
......
...@@ -50,7 +50,7 @@ labjs.wait(function(){ ...@@ -50,7 +50,7 @@ labjs.wait(function(){
templateUrl: 'partials/dashboard.html' templateUrl: 'partials/dashboard.html'
}) })
.otherwise({ .otherwise({
redirectTo: '/dashboard' redirectTo: 'dashboard'
}); });
}]); }]);
angular.element(document).ready(function() { angular.element(document).ready(function() {
......
<a class="close" ng-click="dismiss()" href="">×</a> <a class="close" ng-click="dismiss()" href="">×</a>
<h4>Micro Analysis of {{micropanel.field}}</h4> <h4>
Micro Analysis of {{micropanel.field}}
<i class="pointer icon-search" ng-click="build_search('_exists_',micropanel.field);dismiss();"></i>
<i class="pointer icon-ban-circle" ng-click="build_search('_missing_',micropanel.field);dismiss();"></i>
</h4>
<table style="width:500px" class='table table-bordered table-striped table-condensed'> <table style="width:500px" class='table table-bordered table-striped table-condensed'>
<thead> <thead>
<th>{{micropanel.field}}</th> <th>{{micropanel.field}}</th>
<th>Action</th>
<th>On Page</th> <th>On Page</th>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat='field in micropanel.values'> <tr ng-repeat='field in micropanel.values'>
<td>{{field[0]}}</td><td>{{field[1]}}</td> <td>{{field[0]}}</td>
<td>
<i class="pointer icon-search" ng-click="build_search(micropanel.field,field[0]);dismiss();"></i>
<i class="pointer icon-ban-circle" ng-click="build_search('NOT '+micropanel.field,field[0]);dismiss();"></i>
</td>
<td>{{field[1]}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
\ No newline at end of file
...@@ -18,11 +18,13 @@ angular.module('kibana.fields', []) ...@@ -18,11 +18,13 @@ angular.module('kibana.fields', [])
$scope.active = _.clone(fields.active); $scope.active = _.clone(fields.active);
}); });
eventBus.register($scope,'table_documents', function(event, docs) { eventBus.register($scope,'table_documents', function(event, docs) {
$scope.docs = docs; $scope.panel.query = docs.query;
$scope.docs = docs.docs;
}); });
} }
$scope.toggle_micropanel = function(field) { $scope.toggle_micropanel = function(field) {
//console.log(top_field_values($scope.docs,field,10))
$scope.micropanel = { $scope.micropanel = {
field: field, field: field,
values : top_field_values($scope.docs,field,10) values : top_field_values($scope.docs,field,10)
...@@ -42,6 +44,13 @@ angular.module('kibana.fields', []) ...@@ -42,6 +44,13 @@ angular.module('kibana.fields', [])
eventBus.broadcast($scope.$id,$scope.panel.group,"selected_fields",$scope.active) eventBus.broadcast($scope.$id,$scope.panel.group,"selected_fields",$scope.active)
} }
$scope.build_search = function(field, value) {
var query = field + ":" + "\"" + addslashes(value.toString()) + "\"";
var glue = $scope.panel.query != "" ? " AND " : "";
$scope.panel.query = $scope.panel.query + glue + query;
eventBus.broadcast($scope.$id,$scope.panel.group,'query',$scope.panel.query);
}
$scope.is_active = function(field) { $scope.is_active = function(field) {
return _.indexOf($scope.active,field) > -1 ? ['label','label-info'] : ''; return _.indexOf($scope.active,field) > -1 ? ['label','label-info'] : '';
} }
......
...@@ -130,7 +130,7 @@ angular.module('kibana.table', []) ...@@ -130,7 +130,7 @@ angular.module('kibana.table', [])
active: $scope.panel.fields active: $scope.panel.fields
}); });
eventBus.broadcast($scope.$id,$scope.panel.group,"table_documents", eventBus.broadcast($scope.$id,$scope.panel.group,"table_documents",
$scope.data); {query:$scope.panel.query,docs:$scope.data});
} }
function set_time(time) { function set_time(time) {
......
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