Skip to content

Commit

Permalink
Merge pull request #281 from rashidkpc/master
Browse files Browse the repository at this point in the history
Time filters as longs, panelMeta object, moved add button, removed old group settings, remove status from panel object
  • Loading branch information
Rashid Khan committed Jul 26, 2013
2 parents 5bb5be1 + 13fc14f commit 6090f68
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 114 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = function (grunt) {
files: ['Gruntfile.js', 'js/*.js', 'panels/*/*.js' ],
options: {
bitwise: true,
maxlen: 140,
curly: true,
eqeqeq: true,
immed: true,
Expand Down
1 change: 1 addition & 0 deletions js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ angular.module('kibana.controllers', [])
};

$scope.reset_panel = function() {

$scope.panel = {
loading : false,
error : false,
Expand Down
10 changes: 7 additions & 3 deletions js/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ angular.module('kibana.directives', [])
restrict: 'E',
link: function(scope, elem, attrs) {
var template = '<img src="common/img/load.gif" class="panel-loading" ng-show="panel.loading == true">'+
' <span class="editlink panelextra pointer" style="right:15px;top:0px" bs-modal="\'partials/paneleditor.html\'" ng-show="panel.editable != false">'+
'<span class="small">{{panel.type}}</span> <i class="icon-cog pointer"></i> '+
' <span class="editlink panelextra pointer" style="right:15px;top:0px" ' +
'bs-modal="\'partials/paneleditor.html\'" ng-show="panel.editable != false">'+
'<span class="small">{{panel.type}}</span> <i class="icon-cog pointer"></i> '+
'</span><h4>{{panel.title}}</h4>';
elem.prepend($compile(angular.element(template))(scope));
}
Expand All @@ -21,7 +22,10 @@ angular.module('kibana.directives', [])
link: function(scope, elem, attrs) {
scope.$watch('panel.type', function(n,o) {
if(!_.isUndefined(scope.panel.type)) {
var template = '<div ng-controller="'+scope.panel.type+'" ng-include src="\''+scope.edit_path(scope.panel.type)+'\'"></div>';
var template = '<div>'+
'<div ng-controller="'+scope.panel.type+'" ng-include src="\'partials/panelgeneral.html\'"></div>'+
'<div ng-controller="'+scope.panel.type+'" ng-include src="\''+scope.edit_path(scope.panel.type)+'\'">'+
'</div>';
elem.html($compile(angular.element(template))(scope));
}
});
Expand Down
4 changes: 2 additions & 2 deletions js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ angular.module('kibana.services', [])
{
case 'time':
return ejs.RangeFilter(filter.field)
.from(filter.from)
.to(filter.to);
.from(filter.from.valueOf())
.to(filter.to.valueOf());
case 'range':
return ejs.RangeFilter(filter.field)
.from(filter.from)
Expand Down
9 changes: 1 addition & 8 deletions panels/bettermap/editor.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<div class="row-fluid">
<div class="span11">
This panel uses geoJSON points in a field to place markers on a map.
Coordinates <strong>must be stored as an array in Elasticsearch</strong>.
Also note that geoJSON is <strong>long,lat NOT lat,long</strong>.
</div>
</div>
<div class="row-fluid">
<div class="span4">
<form>
<h6>Coordinate Field</h6>
<h6>Coordinate Field <i class="icon-question-sign" bs-tooltip="'geoJSON array! Long,Lat NOT Lat,Long'"></i></h6>
<input bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.field">
</form>
</div>
Expand Down
17 changes: 10 additions & 7 deletions panels/bettermap/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
## Better maps
So the cavaet for this panel is that, for better or worse, it does NOT use the terms facet and it
DOES query sequentially. This however means that it transfer more data and is generally heavier
to computer, while showing less actual data
### Parameters
* size :: How many results to show, more results = slower
* field :: field containing a 2 element array in the format [lon,lat]
Expand All @@ -21,18 +17,25 @@
angular.module('kibana.bettermap', [])
.controller('bettermap', function($scope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
status : "Experimental",
description : "Displays geo points in clustered groups on a map. The cavaet for this panel is"+
" that, for better or worse, it does NOT use the terms facet and it <b>does</b> query "+
"sequentially. This however means that it transfers more data and is generally heavier to"+
" compute, while showing less actual data. If you have a time filter, it will attempt to"+
" show to most recent points in your search, up to your defined limit"
};

// Set and populate defaults
var _d = {
status : "Experimental",
queries : {
mode : 'all',
ids : []
},
size : 1000,
spyable : true,
tooltip : "_id",
field : null,
group : "default"
field : null
};
_.defaults($scope.panel,_d);

Expand Down
12 changes: 7 additions & 5 deletions panels/column/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
## Column
The column panel is sort of a hack to allow you to put multiple, veritcal,
panels next to a bigger panel. Note that it has no group, and setting a group
for the panel itself will do nothing
### Parameters
* panels :: an array of panel objects. All of their spans should be set to 12
Expand All @@ -17,9 +13,15 @@

angular.module('kibana.column', [])
.controller('column', function($scope, $rootScope, $timeout) {

$scope.panelMeta = {
status : "Stable",
description : "A pseudo panel that lets you add other panels to be arranged in a column with"+
"defined heights."
};

// Set and populate defaults
var _d = {
status: "Stable",
panels : []
};
_.defaults($scope.panel,_d);
Expand Down
14 changes: 7 additions & 7 deletions panels/dashcontrol/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
## Dashcontrol
Dash control allows for saving, loading and sharing of dashboards. Do not
disable the dashcontrol module as a special instance of it allows for loading
the default dashboard from dashboards/default
### Parameters
* save
** gist :: Allow saving to gist. Requires registering an oauth domain with Github
Expand All @@ -30,11 +26,14 @@
angular.module('kibana.dashcontrol', [])
.controller('dashcontrol', function($scope, $http, timer, dashboard) {

$scope.panelMeta = {
status : "Stable",
description : "This panel allows for saving, loading, exporting and sharing dashboard schemas."
};

$scope.panel = $scope.panel || {};
// Set and populate defaults
var _d = {
status : "Stable",
group : "default",
save : {
gist: false,
elasticsearch: true,
Expand Down Expand Up @@ -138,7 +137,8 @@ angular.module('kibana.dashcontrol', [])
function(link) {
if(!_.isUndefined(link)) {
$scope.gist.last = link;
$scope.alert('Gist saved','You will be able to access your exported dashboard file at <a href="'+link+'">'+link+'</a> in a moment','success');
$scope.alert('Gist saved','You will be able to access your exported dashboard file at '+
'<a href="'+link+'">'+link+'</a> in a moment','success');
} else {
$scope.alert('Save failed','Gist could not be saved','error',5000);
}
Expand Down
6 changes: 0 additions & 6 deletions panels/derivequeries/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,4 @@
<input array-join type="text" style="width:90%" ng-change="set_refresh(true)" ng-model='panel.exclude'></input>
</div>
</div>
<div class="row-fluid">
<div class="span12">
The derive queries panel takes a query and a field, runs a terms facet, then creates queries based on them. For example, you might want to see a histogram of the top 5 requests that return a 404. <strong>You should be careful not to select a high cardinality field</strong> as Elasticsearch must load all of these values into memory.<p>
Query Mode allows to optionally append original query to each term in the list.
</div>
</div>
</div>
13 changes: 9 additions & 4 deletions panels/derivequeries/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
## Derivequeries
Broadcasts an array of queries based on the results of a terms facet
### Parameters
* label :: The label to stick over the field
* query :: A string to use as a filter for the terms facet
Expand All @@ -21,14 +19,21 @@
angular.module('kibana.derivequeries', [])
.controller('derivequeries', function($scope, $rootScope, querySrv, fields, dashboard, filterSrv) {

$scope.panelMeta = {
status : "Experimental",
description : "Creates a new set of queries using the Elasticsearch terms facet. For example,"+
" you might want to create 5 queries showing the most frequent HTTP response codes. Be "+
"careful not to select a high cardinality field, as Elasticsearch must load all unique values"+
" into memory."
};


// Set and populate defaults
var _d = {
loading : false,
status : "Beta",
label : "Search",
query : "*",
ids : [],
group : "default",
field : '_type',
fields : [],
spyable : true,
Expand Down
11 changes: 8 additions & 3 deletions panels/fields/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
## Fields
Allows for enabling and disabling of fields in the table panel as well as a
micro anaylsis panel for analyzing the events in the table panel
### Parameters
* style :: a hash containing css styles
Expand All @@ -26,9 +24,16 @@
angular.module('kibana.fields', [])
.controller('fields', function($scope, eventBus, $timeout, dashboard, filterSrv) {

$scope.panelMeta = {
status : "Deprecating Soon",
description : "Allows for enabling and disabling of fields in the table panel as well as a "+
"micro anaylsis panel for analyzing the events in the table panel. This panel will soon be"+
"combined with the table panel"
};


// Set and populate defaults
var _d = {
status : "Beta",
group : "default",
style : {},
arrange : 'vertical',
Expand Down
9 changes: 6 additions & 3 deletions panels/filtering/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
## filtering
An experimental for interacting with the filter service
*/

'use strict';

angular.module('kibana.filtering', [])
.controller('filtering', function($scope, filterSrv, $rootScope, dashboard) {

$scope.panelMeta = {
status : "Beta",
description : "A controllable list of all filters currently applied to the dashboard. You "+
"almost certainly want one of these on your dashboard somewhere."
};

// Set and populate defaults
var _d = {
status : "Beta"
};
_.defaults($scope.panel,_d);

Expand Down
12 changes: 7 additions & 5 deletions panels/histogram/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
## Histogram
A bucketted time series representation of the current query or queries. Note that this
panel uses facetting. I tried to make it safe by using sequential/serial querying but,
yeah, you should know that it uses facetting. It should be pretty safe.
### Parameters
* auto_int :: Auto calculate data point interval?
* resolution :: If auto_int is enables, shoot for this many data points, rounding to
Expand Down Expand Up @@ -40,9 +36,15 @@
angular.module('kibana.histogram', [])
.controller('histogram', function($scope, eventBus, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
status : "Stable",
description : "A bucketed time series chart of the current query or queries. Uses the "+
"Elasticsearch date_histogram facet. If using time stamped indices this panel will query"+
" them sequentially to attempt to apply the lighest possible load to your Elasticsearch cluster"
};

// Set and populate defaults
var _d = {
status : "Stable",
mode : 'count',
time_field : '@timestamp',
queries : {
Expand Down
12 changes: 8 additions & 4 deletions panels/hits/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
## Hits
A variety of representations of the hits a query matches
### Parameters
* style :: A hash of css styles
* arrangement :: How should I arrange the query results? 'horizontal' or 'vertical'
Expand All @@ -22,9 +20,14 @@
angular.module('kibana.hits', [])
.controller('hits', function($scope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
status : "Stable",
description : "The total hits for a query or set of queries. Can be a pie chart, bar chart, "+
"list, or absolute total of all queries combined"
};

// Set and populate defaults
var _d = {
status : "Beta",
queries : {
mode : 'all',
ids : []
Expand Down Expand Up @@ -219,7 +222,8 @@ angular.module('kibana.hits', [])
show: scope.panel.labels,
radius: 2/3,
formatter: function(label, series){
return '<div ng-click="build_search(panel.query.field,\''+label+'\') "style="font-size:8pt;text-align:center;padding:2px;color:white;">'+
return '<div ng-click="build_search(panel.query.field,\''+label+'\')'+
' "style="font-size:8pt;text-align:center;padding:2px;color:white;">'+
label+'<br/>'+Math.round(series.percent)+'%</div>';
},
threshold: 0.1
Expand Down
5 changes: 0 additions & 5 deletions panels/map/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,4 @@ <h5>Panel Spy</h5>
<div class="span2">
<label class="small"> Spyable </label><input type="checkbox" ng-model="panel.spyable" ng-checked="panel.spyable">
</div>
<div class="span9 small">
The panel spy shows 'behind the scenes' information about a panel. It can
be accessed by clicking the <i class='icon-eye-open'></i> in the top right
of the panel.
</div>
</div>
14 changes: 7 additions & 7 deletions panels/map/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
## Map
LOL. Should this even be documented? Zach's map panel is going to ruin this one.
For serious. This shades a map of the world, the US or Europe with the number of
events that match the query. Uses 2 letter country codes and nothing else. This uses
a terms facet. Its probably safe as long as you point it at the right field. Nach.
There's no way to query sequentially here, so I'm going to hit them all at once!
### Parameters
* map :: 'world', 'us' or 'europe'
* colors :: an array of colors to use for the regions of the map. If this is a 2
Expand All @@ -28,9 +22,15 @@
angular.module('kibana.map', [])
.controller('map', function($scope, $rootScope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
status : "Stable",
description : "Displays a map of shaded regions using a field containing a 2 letter country "+
", or US state, code. Regions with more hit are shaded darker. Node that this does use the"+
" Elasticsearch terms facet, so it is important that you set it to the correct field."
};

// Set and populate defaults
var _d = {
status : "Beta",
queries : {
mode : 'all',
ids : []
Expand Down
Loading

0 comments on commit 6090f68

Please sign in to comment.