Skip to content

Commit

Permalink
Color scheme updates, fixed auto refresh for issue #19, added control…
Browse files Browse the repository at this point in the history
… to disable table sorting, moved default.json to dashboards/default
  • Loading branch information
Rashid Khan committed Mar 21, 2013
1 parent f5302fc commit 676e877
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 42 deletions.
40 changes: 20 additions & 20 deletions common/css/bootstrap.min.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions common/lib/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@ function htmlEntities(str) {
/"/g, '"');
}

function bucket_round(start,num,dir) {
var resto = start%num;
if (resto <= (num/2) || dir === 'down') {
// Down
return start-resto;
} else {
// Up
return start+num-resto;
}
}

_.mixin({
move: function (array, fromIndex, toIndex) {
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ modules: Panel modules to load. In the future these will be inferred
from your initial dashboard, though if you share dashboards you
will probably need to list them all here
If you need to configure the default dashboard, please see default.json
If you need to configure the default dashboard, please see dashboards/default
*/
var config = new Settings(
Expand Down
2 changes: 1 addition & 1 deletion dashboards/default
Original file line number Diff line number Diff line change
Expand Up @@ -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/a84f6b8a31d1c4f0ef85 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/36ae0b37025c31dbf344 into the 'Gist' loader, click 'Get' and select the 'Logstash Dashboard' link that appears",
"style": {
"font-size": "14pt"
}
Expand Down
2 changes: 0 additions & 2 deletions panels/dashcontrol/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ angular.module('kibana.dashcontrol', [])
).size($scope.panel.elasticsearch_size).doSearch();
results.then(function(results) {
if(_.isUndefined(results)) {
$scope.panel.error = 'Your query was unsuccessful';
return;
}
$scope.panel.error = false;
Expand All @@ -190,7 +189,6 @@ angular.module('kibana.dashcontrol', [])
).size($scope.panel.elasticsearch_size).doSearch();
results.then(function(results) {
if(_.isUndefined(results)) {
$scope.panel.error = 'Your query was unsuccessful';
return;
}
$scope.panel.error = false;
Expand Down
13 changes: 7 additions & 6 deletions panels/stringquery/editor.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<div ng-controller="stringquery">
<div class="row-fluid">
<div class="span3">
<label class="small">Mulit Query</label><input type="checkbox" ng-change="set_multi(panel.multi) "ng-model="panel.multi" ng-checked="panel.multi">
<div class="span2">
<label class="small">Mulit-query</label><input type="checkbox" ng-change="set_multi(panel.multi) "ng-model="panel.multi" ng-checked="panel.multi">
</div>
<div class="span4" ng-show="panel.multi">
<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 class="span3" ng-show="panel.multi">
<label class="small">Arrangement</label>
<select class="input-small" ng-model="panel.multi_arrange" ng-options="f for f in ['vertical','horizontal']"></select>
</div>
<div class="span4" style="white-space:nowrap">
<div class="span3" 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>
</div>
<div class="row-fluid" ng-show="panel.multi">
<div class="span12">
Expand Down
25 changes: 18 additions & 7 deletions panels/table/editor.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="row-fluid" ng-controller="table">
<div class="span12">
<form class="input-append">
<h5>Query</h5>
<h6>Query</h6>
<input type="text" style="width:90%" ng-model="panel.query">
<button class="btn" ng-click="get_data();"><i class="icon-search"></i></button>
</form>
Expand All @@ -10,31 +10,42 @@ <h5>Query</h5>
<div class="row-fluid">
<div class="span4">
<form class="input-append">
<h5>Add field</h5>
<h6>Add field</h6>
<input bs-typeahead="all_fields" type="text" class="input-small" ng-model='newfield'>
<button class="btn" ng-click="toggle_field(newfield);newfield=''"><i class="icon-plus"></i></button>
</form>
</div>
<div class="span8">
<h5>Selected fields <small>Click to remove</small></h5>
<h6>Selected fields <small>Click to remove</small></h6>
<span style="margin-left:3px" ng-click="toggle_field(field)" ng-repeat="field in $parent.panel.fields" class="label remove pointer">{{field}} </span>
</div>
</div>
<div class="row-fluid">
<div class="span4" style="white-space:nowrap">
<h5>Sort</h5>
<div class="row-fluid">
<div class="span2">
<h6>Sortable</h6><input type="checkbox" ng-model="panel.sortable" ng-checked="panel.sortable">
</div>
<div class="span4" style="white-space:nowrap" ng-show='panel.sortable'>
<h6>Sort</h6>
<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="span3">
<h5>Length</h5>
<h6>Length</h6>
<input type="number" class="input-mini" ng-model="panel.size" ng-change="get_data()">
</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>
<!--<div class="row-fluid" ng-show='panel.sortable'>
<div class="span11">
<h6>A note about sorting</h6>
Allowing sorting can incur a significant performance penalty if using timestamped indices.
Kibana will be unable to query your indices sequentially and thus must query them all at
once. Only enable sorting if your cluster is stout enough to handle it.
</div>
</div>-->
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 2 additions & 1 deletion panels/table/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
<table class="table-hover table table-condensed" ng-style="panel.style">
<thead>
<th style="white-space:nowrap" ng-repeat="field in panel.fields">
<span class="pointer" ng-click="set_sort(field)">
<span class="pointer" ng-click="set_sort(field)" ng-show='panel.sortable'>
{{field}}
<i ng-show='field == panel.sort[0]' class="pointer" ng-class="{'icon-chevron-up': panel.sort[1] == 'asc','icon-chevron-down': panel.sort[1] == 'desc'}"></i>
</span>
<span ng-show='!panel.sortable'>{{field}}</span>
</th>
</thead>
<tbody ng-repeat="row in data" ng-class-odd="'odd'">
Expand Down
1 change: 1 addition & 0 deletions panels/table/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ angular.module('kibana.table', [])
group : "default",
style : {},
fields : [],
sortable: true,
spyable: true,
}
_.defaults($scope.panel,_d)
Expand Down
14 changes: 10 additions & 4 deletions panels/timepicker/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ a pattern
* time_options :: An array of possible time options. Default: ['5m','15m','1h','6h','12h','24h','2d','7d','30d']
* timespan :: The default options selected for the relative view. Default: '15m'
* timefield :: The field in which time is stored in the document.
* index :: Index pattern to match. Literals should be double quoted. Default: '"logstash-"yyyy.mm.dd'
* index :: Index pattern to match. Literals should be double quoted. Default: '_all'
* timed_indices :: Should kibana generate a list of indices to try based on selected time range?
* defaultindex :: Index to failover to if index not found
* refresh: Object containing refresh parameters
* enable :: true/false, enable auto refresh by default. Default: false
* interval :: Seconds between auto refresh. Default: 30
Expand All @@ -32,10 +34,10 @@ angular.module('kibana.timepicker', [])
time_options : ['5m','15m','1h','6h','12h','24h','2d','7d','30d'],
timespan : '15m',
timefield : '@timestamp',
index : '"logstash-"yyyy.mm.dd',
defaultindex : "NOINDEX",
index : '_all',
defaultindex : "_all",
index_interval: "day",
timed_indices : true,
timed_indices : false,
group : "default",
refresh : {
enable : false,
Expand Down Expand Up @@ -77,6 +79,10 @@ angular.module('kibana.timepicker', [])
$scope.time.field = $scope.panel.timefield;
$scope.time_apply();

// Start refresh timer if enabled
if ($scope.panel.refresh.enable)
$scope.set_interval($scope.panel.refresh.interval);

// In the case that a panel is not ready to receive a time event, it may
// request one be sent by broadcasting a 'get_time' with its _id to its group
// This panel can handle multiple groups
Expand Down

0 comments on commit 676e877

Please sign in to comment.