fixed loading of default.json

This commit is contained in:
Rashid Khan 2013-02-28 13:02:52 -07:00
parent 7bd7e3b691
commit 430bdd0343
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,6 @@ angular.module('kibana.controllers', [])
// Load dashboard by event // Load dashboard by event
eventBus.register($scope,'dashboard', function(event,dashboard){ eventBus.register($scope,'dashboard', function(event,dashboard){
console.log(dashboard)
$scope.dashboards = dashboard; $scope.dashboards = dashboard;
_.defaults($scope.dashboards,_d) _.defaults($scope.dashboards,_d)
}) })

View File

@ -48,6 +48,7 @@ angular.module('kibana.dashcontrol', [])
) { ) {
var dashboard = JSON.parse(localStorage['dashboard']); var dashboard = JSON.parse(localStorage['dashboard']);
_.defaults(dashboard,_dash); _.defaults(dashboard,_dash);
$scope.dash_load(JSON.stringify(dashboard))
// No? Ok, grab default.json, its all we have now // No? Ok, grab default.json, its all we have now
} else { } else {
$http({ $http({
@ -56,12 +57,12 @@ angular.module('kibana.dashcontrol', [])
}).success(function(data, status, headers, config) { }).success(function(data, status, headers, config) {
var dashboard = data var dashboard = data
_.defaults(dashboard,_dash); _.defaults(dashboard,_dash);
$scope.dash_load(JSON.stringify(dashboard))
}).error(function(data, status, headers, config) { }).error(function(data, status, headers, config) {
$scope.alert('Default dashboard missing!','Could not locate default.json','error') $scope.alert('Default dashboard missing!','Could not locate default.json','error')
}); });
} }
// Load whatever we have
$scope.dash_load(dashboard)
} }
} }