Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/lib/moment.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ angular.module('kibana.controllers', [])
}
};

$scope.setEditorTabs = function(panelMeta) {
$scope.editorTabs = ['General','Panel'];
if(!_.isUndefined(panelMeta.editorTabs)) {
$scope.editorTabs = _.union($scope.editorTabs,_.pluck(panelMeta.editorTabs,'title'));
}
return $scope.editorTabs;
};

// This is whoafully incomplete, but will do for now
$scope.parse_error = function(data) {
var _error = data.match("nested: (.*?);");
Expand Down Expand Up @@ -125,8 +133,7 @@ angular.module('kibana.controllers', [])
$scope.panel = {
error : false,
span : 3,
editable: true,
group : ['default']
editable: true
};
};

Expand Down
7 changes: 3 additions & 4 deletions js/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ angular.module('kibana.directives', [])
link: function(scope, elem, attrs) {
scope.$watch('panel.type', function(n,o) {
if(!_.isUndefined(scope.panel.type)) {
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>';
var template = '<div ng-controller="'+scope.panel.type+'">'+
'<span ng-include src="\'partials/paneladd.html\'"></span>'+
'</div>';
elem.html($compile(angular.element(template))(scope));
}
});
Expand Down
3 changes: 1 addition & 2 deletions js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ angular.module('kibana.services', [])
}
}
})

.service('timer', function($timeout) {
// This service really just tracks a list of $timeout promises to give us a
// method for cancelling them all when we need to
Expand Down Expand Up @@ -451,7 +450,7 @@ angular.module('kibana.services', [])

// TOFIX: Error handling when there is more than one field
this.timeField = function() {
return self.getByType('time')[0].field;
return _.pluck(self.getByType('time'),'field');
};

// This special function looks for all time filters, and returns a time range according to the mode
Expand Down
1 change: 0 additions & 1 deletion panels/bettermap/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ <h6>Tooltip Field</h6>
<input type="number" class="input-small" ng-model="panel.size">
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 3 additions & 0 deletions panels/bettermap/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ angular.module('kibana.bettermap', [])
.controller('bettermap', function($scope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
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 "+
Expand Down
1 change: 0 additions & 1 deletion panels/column/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ angular.module('kibana.column', [])
span: 12,
height: "150px",
editable: true,
group: ['default'],
type: type,
};
};
Expand Down
1 change: 0 additions & 1 deletion panels/fields/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ angular.module('kibana.fields', [])

// Set and populate defaults
var _d = {
group : "default",
style : {},
arrange : 'vertical',
micropanel_position : 'right',
Expand Down
1 change: 0 additions & 1 deletion panels/histogram/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ <h5>Chart Settings</h5>
<label class="small">Use Elasticsearch date math format (eg 1m, 5m, 1d, 2w, 1y)</label>
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 3 additions & 0 deletions panels/histogram/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ angular.module('kibana.histogram', [])
.controller('histogram', function($scope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
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"+
Expand Down
1 change: 0 additions & 1 deletion panels/hits/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<label class="small">Labels</label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels">
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 3 additions & 0 deletions panels/hits/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ angular.module('kibana.hits', [])
.controller('hits', function($scope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
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"
Expand Down
7 changes: 0 additions & 7 deletions panels/map/editor.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<div class="row-fluid">
<div class="span11">
The map panel uses 2 letter country or US state codes to plot concentrations on a map. Darker terroritories mean more records matched that area. If multiple queries are sent from a single panel the <strong>first query will be displayed</strong>
</div>
</div>

<div class="row-fluid">
<div class="span3">
<form>
Expand All @@ -15,7 +9,6 @@ <h6>Field</h6>
<select ng-change="$emit('render')" class="input-small" ng-model="panel.map" ng-options="f for f in ['world','europe','usa']"></select>
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 3 additions & 0 deletions panels/map/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ angular.module('kibana.map', [])
.controller('map', function($scope, $rootScope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
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"+
Expand Down
1 change: 0 additions & 1 deletion panels/pie/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
<select class="input-small" ng-model="panel.legend" ng-options="f for f in ['above','below','none']"></select></span>
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 3 additions & 0 deletions panels/pie/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ angular.module('kibana.pie', [])

// Set and populate defaults
var _d = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
query : { field:"_type", goal: 100},
queries : {
mode : 'all',
Expand Down
2 changes: 2 additions & 0 deletions panels/query/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ angular.module('kibana.query', [])
}
};

$scope.init();

});
4 changes: 1 addition & 3 deletions panels/table/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ <h6>Pageable</h6>
<h6>Page Overflow</h6>
<select class="input-small" ng-model="panel.overflow" ng-options="f.value as f.key for f in [{key:'scroll',value:'height'},{key:'expand',value:'min-height'}]"></select>
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
</div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand All @@ -84,4 +83,3 @@ <h5>Panel Spy</h5>
of the panel.
</div>
</div>

5 changes: 4 additions & 1 deletion panels/table/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ angular.module('kibana.table', [])
.controller('table', function($rootScope, $scope, fields, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status: "Stable",
description: "A paginated table of records matching your query or queries. Click on a row to "+
"expand it and review all of the fields associated with that document. <p>"
Expand Down Expand Up @@ -221,7 +224,7 @@ angular.module('kibana.table', [])
// size*pages results
// Otherwise, only get size*pages results then stop querying
if (($scope.data.length < $scope.panel.size*$scope.panel.pages ||
!(($scope.panel.sort[0] === filterSrv.timeField()) && $scope.panel.sort[1] === 'desc')) &&
!((_.contains(filterSrv.timeField(),$scope.panel.sort[0])) && $scope.panel.sort[1] === 'desc')) &&
_segment+1 < dashboard.indices.length) {
$scope.get_data(_segment+1,$scope.query_id);
}
Expand Down
1 change: 0 additions & 1 deletion panels/terms/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<label class="small">Labels</label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels">
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5>
<div class="row-fluid">
<div class="span2">
Expand Down
3 changes: 3 additions & 0 deletions panels/terms/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ angular.module('kibana.terms', [])
.controller('terms', function($scope, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Beta",
description : "Displays the results of an elasticsearch facet as a pie chart, bar chart, or a "+
"table"
Expand Down
3 changes: 0 additions & 3 deletions panels/timepicker/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ angular.module('kibana.timepicker', [])
};
_.defaults($scope.panel,_d);

var _groups = _.isArray($scope.panel.group) ?
$scope.panel.group : [$scope.panel.group];

$scope.init = function() {
// Private refresh interval that we can use for view display without causing
// unnecessary refreshes during changes
Expand Down
1 change: 0 additions & 1 deletion panels/trends/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ <h4>Settings</h4>
<select class="input-small" ng-model="panel.arrangement" ng-options="f for f in ['horizontal','vertical']"></select></span>
</div>
</div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
</div>
3 changes: 3 additions & 0 deletions panels/trends/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ angular.module('kibana.trends', [])
.controller('trends', function($scope, kbnIndex, querySrv, dashboard, filterSrv) {

$scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Beta",
description : "A stock-ticker style representation of how queries are moving over time. "+
"For example, if the time is 1:10pm, your time picker was set to \"Last 10m\", and the \"Time "+
Expand Down
8 changes: 4 additions & 4 deletions partials/dasheditor.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="pull-right editor-title">Dashboard settings</div>

<div ng-model="editor.index" bs-tabs>
<div ng-repeat="tab in ['General','Index','Rows']" data-title="{{tab}}">
<div ng-repeat="tab in ['General','Index','Rows','Date/Time']" data-title="{{tab}}">
</div>
</div>

Expand Down Expand Up @@ -86,11 +86,11 @@ <h6>Default Index <small ng-show="dashboard.current.index.interval != 'none'">If
</div>
</form>
</div>
<div class="row-fluid" ng-show="editor.index == 3">
</div>
<!--<div class="row-fluid" ng-show="editor.index == 3">
<h6>Region</h6><select class="input-small" ng-model="dashboard.current.time.region" ng-options='f for f in ["africa","america","asia","atlantic","australia","europe","indian","pacific"]'></select>
</div>-->
</div>
<div class="modal-footer">
<button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 2">Create Row</button>

<button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
</div>
3 changes: 1 addition & 2 deletions partials/inspector.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Inspector</h3>
<h3>Last Elasticsearch Query</h3>
</div>
<div class="modal-body">

<div>
<h5>Last Elasticsearch Query</h5>
<pre>curl -XGET '{{config.elasticsearch}}/{{dashboard.indices|stringify}}/_search?pretty' -d '{{inspector}}'
</pre>
</div>
Expand Down
12 changes: 12 additions & 0 deletions partials/paneladd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
<div ng-include src="'partials/panelgeneral.html'"></div>
</div>

<div>
<div ng-include src="edit_path(panel.type)"></div>
</div>

<div ng-repeat="tab in panelMeta.editorTabs" ng-show="addTab == tab.title">
<h4>{{tab.title}}</h4>
<div ng-include src="tab.src"></div>
</div>
15 changes: 9 additions & 6 deletions partials/paneleditor.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<div class="modal-body" >
<div class="modal-body">
<div class="pull-right editor-title">{{panel.type}} settings</div>

<div ng-model="editor.index" bs-tabs>
<div ng-repeat="tab in ['General','Panel']" data-title="{{tab}}">
<div ng-repeat="tab in setEditorTabs(panelMeta)" data-title="{{tab}}">
</div>
</div>
<div ng-show="editor.index == 0">
<div ng-show="editorTabs[editor.index] == 'General'">
<div ng-include src="'partials/panelgeneral.html'"></div>
</div>

<div ng-show="editor.index == 1">
<div ng-include src="edit_path(panel.type)">No additional settings are available for this type of panel.</div>
<div ng-show="editorTabs[editor.index] == 'Panel'">
<div ng-include src="edit_path(panel.type)"></div>
</div>

<div ng-repeat="tab in panelMeta.editorTabs" ng-show="editorTabs[editor.index] == tab.title">
<div ng-include src="tab.src"></div>
</div>
</div>

<div class="modal-footer">
<!-- close_edit() is provided here to allow for a scope to perform action on dismiss -->
<button type="button" class="btn btn-danger" ng-click="editor.index=0;close_edit();dismiss()">Close</button>
Expand Down
43 changes: 23 additions & 20 deletions partials/querySelect.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<style>
.querySelect .query {
margin-right: 5px;
}
.querySelect .selected {
border: 3px solid;
}
.querySelect .unselected {
border: 0px solid;
}
</style>
<h4>Queries</h4>
<div class="span2" style="margin-left:0px">
<select class="input-small" ng-change="set_refresh(true);" ng-model="panel.queries.mode" ng-options="f for f in ['all','pinned','unpinned','selected']"></select>
</div>
<div class="span9 querySelect" ng-show="panel.queries.mode == 'selected'">
<span ng-style="{'border-color': querySrv.list[id].color}" ng-class="{selected:_.contains(panel.queries.ids,id),unselected:!_.contains(panel.queries.ids,id)}" ng-repeat="id in querySrv.ids" ng-click="panel.queries.ids = _.toggleInOut(panel.queries.ids,id);set_refresh(true);" class="query pointer badge">
<i class="icon-circle" ng-style="{color: querySrv.list[id].color}"></i>
<span> {{querySrv.list[id].alias || querySrv.list[id].query}}</span>
</span>
<div class="row-fluid">
<style>
.querySelect .query {
margin-right: 5px;
}
.querySelect .selected {
border: 3px solid;
}
.querySelect .unselected {
border: 0px solid;
}
</style>
<div class="span2" style="margin-left:0px">
<label class="small">Queries</label>
<select class="input-small" ng-change="set_refresh(true);" ng-model="panel.queries.mode" ng-options="f for f in ['all','pinned','unpinned','selected']"></select>
</div>
<div class="span9 querySelect" ng-show="panel.queries.mode == 'selected'">
<label class="small">Selected Queries</label>
<span ng-style="{'border-color': querySrv.list[id].color}" ng-class="{selected:_.contains(panel.queries.ids,id),unselected:!_.contains(panel.queries.ids,id)}" ng-repeat="id in querySrv.ids" ng-click="panel.queries.ids = _.toggleInOut(panel.queries.ids,id);set_refresh(true);" class="query pointer badge">
<i class="icon-circle" ng-style="{color: querySrv.list[id].color}"></i>
<span> {{querySrv.list[id].alias || querySrv.list[id].query}}</span>
</span>
</div>
</div>
2 changes: 1 addition & 1 deletion sample/apache_ldap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</Proxy>

# Proxy for _aliases and .*/_search
<LocationMatch "^(/_aliases|.*/_search)$">
<LocationMatch "^(/_aliases|.*/_search|.*/_mapping)$">
ProxyPassMatch http://127.0.0.1:9200
ProxyPassReverse http://127.0.0.1:9200
</LocationMatch>
Expand Down
Loading