|
|
@ -101,7 +101,7 @@ angular.module('kibana.histogram', []) |
|
|
|
$scope.get_data = function(segment,query_id) { |
|
|
|
$scope.get_data = function(segment,query_id) { |
|
|
|
delete $scope.panel.error |
|
|
|
delete $scope.panel.error |
|
|
|
// Make sure we have everything for the request to complete
|
|
|
|
// Make sure we have everything for the request to complete
|
|
|
|
if(_.isUndefined($scope.panel.index) || _.isUndefined($scope.time)) |
|
|
|
if(_.isUndefined($scope.index) || _.isUndefined($scope.time)) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
if ($scope.panel.auto_int) |
|
|
|
if ($scope.panel.auto_int) |
|
|
@ -109,7 +109,7 @@ angular.module('kibana.histogram', []) |
|
|
|
|
|
|
|
|
|
|
|
$scope.panel.loading = true; |
|
|
|
$scope.panel.loading = true; |
|
|
|
var _segment = _.isUndefined(segment) ? 0 : segment |
|
|
|
var _segment = _.isUndefined(segment) ? 0 : segment |
|
|
|
var request = $scope.ejs.Request().indices($scope.panel.index[_segment]); |
|
|
|
var request = $scope.ejs.Request().indices($scope.index[_segment]); |
|
|
|
|
|
|
|
|
|
|
|
// Build the question part of the query
|
|
|
|
// Build the question part of the query
|
|
|
|
var queries = []; |
|
|
|
var queries = []; |
|
|
@ -200,7 +200,7 @@ angular.module('kibana.histogram', []) |
|
|
|
$scope.$emit('render') |
|
|
|
$scope.$emit('render') |
|
|
|
|
|
|
|
|
|
|
|
// If we still have segments left, get them
|
|
|
|
// If we still have segments left, get them
|
|
|
|
if(_segment < $scope.panel.index.length-1) { |
|
|
|
if(_segment < $scope.index.length-1) { |
|
|
|
$scope.get_data(_segment+1,query_id) |
|
|
|
$scope.get_data(_segment+1,query_id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -219,7 +219,7 @@ angular.module('kibana.histogram', []) |
|
|
|
$scope.modal = { |
|
|
|
$scope.modal = { |
|
|
|
title: "Inspector", |
|
|
|
title: "Inspector", |
|
|
|
body : "<h5>Last Elasticsearch Query</h5><pre>"+ |
|
|
|
body : "<h5>Last Elasticsearch Query</h5><pre>"+ |
|
|
|
'curl -XGET '+config.elasticsearch+'/'+$scope.panel.index+"/_search?pretty -d'\n"+ |
|
|
|
'curl -XGET '+config.elasticsearch+'/'+$scope.index+"/_search?pretty -d'\n"+ |
|
|
|
angular.toJson(JSON.parse(request.toString()),true)+ |
|
|
|
angular.toJson(JSON.parse(request.toString()),true)+ |
|
|
|
"'</pre>",
|
|
|
|
"'</pre>",
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -240,7 +240,7 @@ angular.module('kibana.histogram', []) |
|
|
|
$scope.time = time; |
|
|
|
$scope.time = time; |
|
|
|
// Should I be storing the index on the panel? It causes errors if the index
|
|
|
|
// Should I be storing the index on the panel? It causes errors if the index
|
|
|
|
// goes away. Hmmm.
|
|
|
|
// goes away. Hmmm.
|
|
|
|
$scope.panel.index = time.index || $scope.panel.index |
|
|
|
$scope.index = time.index || $scope.index |
|
|
|
// Only calculate interval if auto_int is set, otherwise don't touch it
|
|
|
|
// Only calculate interval if auto_int is set, otherwise don't touch it
|
|
|
|
|
|
|
|
|
|
|
|
$scope.get_data(); |
|
|
|
$scope.get_data(); |
|
|
|