Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Closes elastic#203 - Fixing missing dashboard.indices error
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed May 1, 2014
1 parent 0d2a280 commit 1aa20ae
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions kibana/panels/shard_allocation/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ define(function (require) {
fastBackward: true
};

$scope.timeRange = {};

// Inject dependicies for the getTimelineData
var getTimeline = getTimelineDataGenerator($http, dashboard, filterSrv);
var getStateSource = getStateSourceGenerator($http);
Expand Down Expand Up @@ -288,7 +290,13 @@ define(function (require) {

if (timeChanged) {
$scope.timeRange = timeRange;
getTimeline().then(handleTimeline, handleConnectionError);
getTimeline().then(handleTimeline, handleConnectionError).then(function () {
// Don't start listening to updates till we finish initlaizing
if ($scope.startup) {
$clusterState.$on('update', handleUpdatesFromClusterState($scope));
$scope.startup = false;
}
});
}
});

Expand All @@ -311,14 +319,16 @@ define(function (require) {
};

$scope.init = function () {
$scope.timeRange = filterSrv.timeRange(false);
$scope.style = dashboard.current.style;
$scope.timelineData = [];
$scope.showHead = false;
getTimeline().then(handleTimeline, handleConnectionError).then(function () {
// Don't start listening to updates till we finish initlaizing
$clusterState.$on('update', handleUpdatesFromClusterState($scope));
});
$scope.startup = true;

// if dashboard indices is not empty then we need to trigger a refresh
// incase we missed the inital load.
if (dashboard.indices.length !== 0) {
$scope.$broadcast('refresh');
}
};
});
});

0 comments on commit 1aa20ae

Please sign in to comment.