Commit 736a1aea by Rashid Khan

Merge pull request #380 from rashidkpc/master

New panel tabs, upgraded momentjs, added _mapping to proxy samples
parents 03057e54 02f2ff29
...@@ -71,6 +71,14 @@ angular.module('kibana.controllers', []) ...@@ -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 // This is whoafully incomplete, but will do for now
$scope.parse_error = function(data) { $scope.parse_error = function(data) {
var _error = data.match("nested: (.*?);"); var _error = data.match("nested: (.*?);");
...@@ -125,8 +133,7 @@ angular.module('kibana.controllers', []) ...@@ -125,8 +133,7 @@ angular.module('kibana.controllers', [])
$scope.panel = { $scope.panel = {
error : false, error : false,
span : 3, span : 3,
editable: true, editable: true
group : ['default']
}; };
}; };
......
...@@ -26,10 +26,9 @@ angular.module('kibana.directives', []) ...@@ -26,10 +26,9 @@ angular.module('kibana.directives', [])
link: function(scope, elem, attrs) { link: function(scope, elem, attrs) {
scope.$watch('panel.type', function(n,o) { scope.$watch('panel.type', function(n,o) {
if(!_.isUndefined(scope.panel.type)) { if(!_.isUndefined(scope.panel.type)) {
var template = '<div>'+ var template = '<div ng-controller="'+scope.panel.type+'">'+
'<div ng-controller="'+scope.panel.type+'" ng-include src="\'partials/panelgeneral.html\'"></div>'+ '<span ng-include src="\'partials/paneladd.html\'"></span>'+
'<div ng-controller="'+scope.panel.type+'" ng-include src="\''+scope.edit_path(scope.panel.type)+'\'">'+ '</div>';
'</div>';
elem.html($compile(angular.element(template))(scope)); elem.html($compile(angular.element(template))(scope));
} }
}); });
......
...@@ -166,7 +166,6 @@ angular.module('kibana.services', []) ...@@ -166,7 +166,6 @@ angular.module('kibana.services', [])
} }
} }
}) })
.service('timer', function($timeout) { .service('timer', function($timeout) {
// This service really just tracks a list of $timeout promises to give us a // This service really just tracks a list of $timeout promises to give us a
// method for cancelling them all when we need to // method for cancelling them all when we need to
...@@ -451,7 +450,7 @@ angular.module('kibana.services', []) ...@@ -451,7 +450,7 @@ angular.module('kibana.services', [])
// TOFIX: Error handling when there is more than one field // TOFIX: Error handling when there is more than one field
this.timeField = function() { 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 // This special function looks for all time filters, and returns a time range according to the mode
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<input type="number" class="input-small" ng-model="panel.size"> <input type="number" class="input-small" ng-model="panel.size">
</div> </div>
</div> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
......
...@@ -18,6 +18,9 @@ angular.module('kibana.bettermap', []) ...@@ -18,6 +18,9 @@ angular.module('kibana.bettermap', [])
.controller('bettermap', function($scope, querySrv, dashboard, filterSrv) { .controller('bettermap', function($scope, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Experimental", status : "Experimental",
description : "Displays geo points in clustered groups on a map. The cavaet for this panel is"+ 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 "+ " that, for better or worse, it does NOT use the terms facet and it <b>does</b> query "+
......
...@@ -55,7 +55,6 @@ angular.module('kibana.column', []) ...@@ -55,7 +55,6 @@ angular.module('kibana.column', [])
span: 12, span: 12,
height: "150px", height: "150px",
editable: true, editable: true,
group: ['default'],
type: type, type: type,
}; };
}; };
......
...@@ -21,7 +21,6 @@ angular.module('kibana.fields', []) ...@@ -21,7 +21,6 @@ angular.module('kibana.fields', [])
// Set and populate defaults // Set and populate defaults
var _d = { var _d = {
group : "default",
style : {}, style : {},
arrange : 'vertical', arrange : 'vertical',
micropanel_position : 'right', micropanel_position : 'right',
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
<label class="small">Use Elasticsearch date math format (eg 1m, 5m, 1d, 2w, 1y)</label> <label class="small">Use Elasticsearch date math format (eg 1m, 5m, 1d, 2w, 1y)</label>
</div> </div>
</div> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
......
...@@ -37,6 +37,9 @@ angular.module('kibana.histogram', []) ...@@ -37,6 +37,9 @@ angular.module('kibana.histogram', [])
.controller('histogram', function($scope, querySrv, dashboard, filterSrv) { .controller('histogram', function($scope, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Stable", status : "Stable",
description : "A bucketed time series chart of the current query or queries. Uses the "+ 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"+ "Elasticsearch date_histogram facet. If using time stamped indices this panel will query"+
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
<label class="small">Labels</label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels"> <label class="small">Labels</label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels">
</div> </div>
</div> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
......
...@@ -21,6 +21,9 @@ angular.module('kibana.hits', []) ...@@ -21,6 +21,9 @@ angular.module('kibana.hits', [])
.controller('hits', function($scope, querySrv, dashboard, filterSrv) { .controller('hits', function($scope, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Stable", status : "Stable",
description : "The total hits for a query or set of queries. Can be a pie chart, bar chart, "+ 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" "list, or absolute total of all queries combined"
......
<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="row-fluid">
<div class="span3"> <div class="span3">
<form> <form>
...@@ -15,7 +9,6 @@ ...@@ -15,7 +9,6 @@
<select ng-change="$emit('render')" class="input-small" ng-model="panel.map" ng-options="f for f in ['world','europe','usa']"></select> <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> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
......
...@@ -23,6 +23,9 @@ angular.module('kibana.map', []) ...@@ -23,6 +23,9 @@ angular.module('kibana.map', [])
.controller('map', function($scope, $rootScope, querySrv, dashboard, filterSrv) { .controller('map', function($scope, $rootScope, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Stable", status : "Stable",
description : "Displays a map of shaded regions using a field containing a 2 letter country "+ 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"+ ", or US state, code. Regions with more hit are shaded darker. Node that this does use the"+
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
<select class="input-small" ng-model="panel.legend" ng-options="f for f in ['above','below','none']"></select></span> <select class="input-small" ng-model="panel.legend" ng-options="f for f in ['above','below','none']"></select></span>
</div> </div>
</div> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
......
...@@ -33,6 +33,9 @@ angular.module('kibana.pie', []) ...@@ -33,6 +33,9 @@ angular.module('kibana.pie', [])
// Set and populate defaults // Set and populate defaults
var _d = { var _d = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
query : { field:"_type", goal: 100}, query : { field:"_type", goal: 100},
queries : { queries : {
mode : 'all', mode : 'all',
......
...@@ -60,4 +60,6 @@ angular.module('kibana.query', []) ...@@ -60,4 +60,6 @@ angular.module('kibana.query', [])
} }
}; };
$scope.init();
}); });
\ No newline at end of file
...@@ -71,8 +71,7 @@ ...@@ -71,8 +71,7 @@
<h6>Page Overflow</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> <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> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
...@@ -84,4 +83,3 @@ ...@@ -84,4 +83,3 @@
of the panel. of the panel.
</div> </div>
</div> </div>
...@@ -26,6 +26,9 @@ angular.module('kibana.table', []) ...@@ -26,6 +26,9 @@ angular.module('kibana.table', [])
.controller('table', function($rootScope, $scope, fields, querySrv, dashboard, filterSrv) { .controller('table', function($rootScope, $scope, fields, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status: "Stable", status: "Stable",
description: "A paginated table of records matching your query or queries. Click on a row to "+ 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 it and review all of the fields associated with that document. <p>"
...@@ -221,7 +224,7 @@ angular.module('kibana.table', []) ...@@ -221,7 +224,7 @@ angular.module('kibana.table', [])
// size*pages results // size*pages results
// Otherwise, only get size*pages results then stop querying // Otherwise, only get size*pages results then stop querying
if (($scope.data.length < $scope.panel.size*$scope.panel.pages || 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) { _segment+1 < dashboard.indices.length) {
$scope.get_data(_segment+1,$scope.query_id); $scope.get_data(_segment+1,$scope.query_id);
} }
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
<label class="small">Labels</label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels"> <label class="small">Labels</label><input type="checkbox" ng-model="panel.labels" ng-checked="panel.labels">
</div> </div>
</div> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
<h5>Panel Spy</h5> <h5>Panel Spy</h5>
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
......
...@@ -22,6 +22,9 @@ angular.module('kibana.terms', []) ...@@ -22,6 +22,9 @@ angular.module('kibana.terms', [])
.controller('terms', function($scope, querySrv, dashboard, filterSrv) { .controller('terms', function($scope, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Beta", status : "Beta",
description : "Displays the results of an elasticsearch facet as a pie chart, bar chart, or a "+ description : "Displays the results of an elasticsearch facet as a pie chart, bar chart, or a "+
"table" "table"
......
...@@ -43,9 +43,6 @@ angular.module('kibana.timepicker', []) ...@@ -43,9 +43,6 @@ angular.module('kibana.timepicker', [])
}; };
_.defaults($scope.panel,_d); _.defaults($scope.panel,_d);
var _groups = _.isArray($scope.panel.group) ?
$scope.panel.group : [$scope.panel.group];
$scope.init = function() { $scope.init = function() {
// Private refresh interval that we can use for view display without causing // Private refresh interval that we can use for view display without causing
// unnecessary refreshes during changes // unnecessary refreshes during changes
......
...@@ -26,5 +26,4 @@ ...@@ -26,5 +26,4 @@
<select class="input-small" ng-model="panel.arrangement" ng-options="f for f in ['horizontal','vertical']"></select></span> <select class="input-small" ng-model="panel.arrangement" ng-options="f for f in ['horizontal','vertical']"></select></span>
</div> </div>
</div> </div>
<div class="row-fluid" ng-include="'partials/querySelect.html'"></div>
</div> </div>
...@@ -17,6 +17,9 @@ angular.module('kibana.trends', []) ...@@ -17,6 +17,9 @@ angular.module('kibana.trends', [])
.controller('trends', function($scope, kbnIndex, querySrv, dashboard, filterSrv) { .controller('trends', function($scope, kbnIndex, querySrv, dashboard, filterSrv) {
$scope.panelMeta = { $scope.panelMeta = {
editorTabs : [
{title:'Queries', src:'partials/querySelect.html'}
],
status : "Beta", status : "Beta",
description : "A stock-ticker style representation of how queries are moving over time. "+ 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 "+ "For example, if the time is 1:10pm, your time picker was set to \"Last 10m\", and the \"Time "+
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="pull-right editor-title">Dashboard settings</div> <div class="pull-right editor-title">Dashboard settings</div>
<div ng-model="editor.index" bs-tabs> <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>
</div> </div>
...@@ -86,11 +86,11 @@ ...@@ -86,11 +86,11 @@
</div> </div>
</form> </form>
</div> </div>
<div class="row-fluid" ng-show="editor.index == 3"> <!--<div class="row-fluid" ng-show="editor.index == 3">
</div> <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>
<div class="modal-footer"> <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 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> <button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
</div> </div>
\ No newline at end of file
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Inspector</h3> <h3>Last Elasticsearch Query</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div> <div>
<h5>Last Elasticsearch Query</h5>
<pre>curl -XGET '{{config.elasticsearch}}/{{dashboard.indices|stringify}}/_search?pretty' -d '{{inspector}}' <pre>curl -XGET '{{config.elasticsearch}}/{{dashboard.indices|stringify}}/_search?pretty' -d '{{inspector}}'
</pre> </pre>
</div> </div>
......
<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>
\ No newline at end of file
<div class="modal-body" > <div class="modal-body">
<div class="pull-right editor-title">{{panel.type}} settings</div> <div class="pull-right editor-title">{{panel.type}} settings</div>
<div ng-model="editor.index" bs-tabs> <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> </div>
<div ng-show="editor.index == 0"> <div ng-show="editorTabs[editor.index] == 'General'">
<div ng-include src="'partials/panelgeneral.html'"></div> <div ng-include src="'partials/panelgeneral.html'"></div>
</div> </div>
<div ng-show="editor.index == 1"> <div ng-show="editorTabs[editor.index] == 'Panel'">
<div ng-include src="edit_path(panel.type)">No additional settings are available for this type of panel.</div> <div ng-include src="edit_path(panel.type)"></div>
</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>
<div class="modal-footer"> <div class="modal-footer">
<!-- close_edit() is provided here to allow for a scope to perform action on dismiss --> <!-- 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> <button type="button" class="btn btn-danger" ng-click="editor.index=0;close_edit();dismiss()">Close</button>
......
<style> <div class="row-fluid">
.querySelect .query { <style>
margin-right: 5px; .querySelect .query {
} margin-right: 5px;
.querySelect .selected { }
border: 3px solid; .querySelect .selected {
} border: 3px solid;
.querySelect .unselected { }
border: 0px solid; .querySelect .unselected {
} border: 0px solid;
</style> }
<h4>Queries</h4> </style>
<div class="span2" style="margin-left:0px"> <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> <label class="small">Queries</label>
</div> <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 class="span9 querySelect" ng-show="panel.queries.mode == 'selected'"> </div>
<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"> <div class="span9 querySelect" ng-show="panel.queries.mode == 'selected'">
<i class="icon-circle" ng-style="{color: querySrv.list[id].color}"></i> <label class="small">Selected Queries</label>
<span> {{querySrv.list[id].alias || querySrv.list[id].query}}</span> <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">
</span> <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> </div>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</Proxy> </Proxy>
# Proxy for _aliases and .*/_search # Proxy for _aliases and .*/_search
<LocationMatch "^(/_aliases|.*/_search)$"> <LocationMatch "^(/_aliases|.*/_search|.*/_mapping)$">
ProxyPassMatch http://127.0.0.1:9200 ProxyPassMatch http://127.0.0.1:9200
ProxyPassReverse http://127.0.0.1:9200 ProxyPassReverse http://127.0.0.1:9200
</LocationMatch> </LocationMatch>
......
...@@ -29,6 +29,10 @@ server { ...@@ -29,6 +29,10 @@ server {
proxy_pass http://127.0.0.1:9200; proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90; proxy_read_timeout 90;
} }
location ~ ^/.*/_mapping$ {
proxy_pass http://127.0.0.1:9200;
proxy_read_timeout 90;
}
# Password protected end points # Password protected end points
location ~ ^/kibana-int/dashboard/.*$ { location ~ ^/kibana-int/dashboard/.*$ {
......
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