Added drilldown links to micropanel

This commit is contained in:
Rashid Khan 2013-02-20 08:40:18 -07:00
parent 77ce7b9158
commit 48ad884ee2
7 changed files with 28 additions and 8 deletions

View File

@ -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://demo.logstash.net:9200',
timeformat: 'mm/dd HH:MM:ss',
modules: ['histogram','map','pie','table','stringquery','sort',
'timepicker','text','fields','hits','dashcontrol'],

View File

@ -14,7 +14,7 @@
],
"type": "text",
"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": {
"font-size": "14pt"
}

View File

@ -36,7 +36,7 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<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>
<div class="brand"><i class='icon-edit pointer' ng-show='dashboards.editable' bs-modal="'partials/dasheditor.html'"></i></div>
</div>

View File

@ -50,7 +50,7 @@ labjs.wait(function(){
templateUrl: 'partials/dashboard.html'
})
.otherwise({
redirectTo: '/dashboard'
redirectTo: 'dashboard'
});
}]);
angular.element(document).ready(function() {

View File

@ -1,13 +1,24 @@
<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'>
<thead>
<th>{{micropanel.field}}</th>
<th>Action</th>
<th>On Page</th>
</thead>
<tbody>
<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>
</tbody>
</table>

View File

@ -18,11 +18,13 @@ angular.module('kibana.fields', [])
$scope.active = _.clone(fields.active);
});
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) {
//console.log(top_field_values($scope.docs,field,10))
$scope.micropanel = {
field: field,
values : top_field_values($scope.docs,field,10)
@ -42,6 +44,13 @@ angular.module('kibana.fields', [])
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) {
return _.indexOf($scope.active,field) > -1 ? ['label','label-info'] : '';
}

View File

@ -130,7 +130,7 @@ angular.module('kibana.table', [])
active: $scope.panel.fields
});
eventBus.broadcast($scope.$id,$scope.panel.group,"table_documents",
$scope.data);
{query:$scope.panel.query,docs:$scope.data});
}
function set_time(time) {