Skip to content

Commit

Permalink
Fixed issue where dashboards with old timepicker settings would fail.…
Browse files Browse the repository at this point in the history
… Now throws error on timepicker
  • Loading branch information
Rashid Khan committed May 29, 2013
1 parent 6eae38e commit 1818000
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions panels/timepicker/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ angular.module('kibana.timepicker', [])
};
}

$scope.time_apply = function() {
$scope.time_apply = function() {
$scope.panel.error = "";
// Update internal time object
$scope.time = $scope.time_calc();
$scope.time.field = $scope.panel.timefield
Expand All @@ -213,8 +214,12 @@ angular.module('kibana.timepicker', [])
$scope.panel.index,
$scope.panel.index_interval
).then(function (p) {
$scope.time.index = p;
eventBus.broadcast($scope.$id,$scope.panel.group,'time',compile_time($scope.time))
if(p.length > 0) {
$scope.time.index = p;
eventBus.broadcast($scope.$id,$scope.panel.group,'time',compile_time($scope.time))
} else {
$scope.panel.error = "Could not match index pattern to any ElasticSearch indices"
}
});
} else {
$scope.time.index = [$scope.panel.index];
Expand Down

0 comments on commit 1818000

Please sign in to comment.