Commit 430bdd03 by Rashid Khan

fixed loading of default.json

parent 7bd7e3b6
...@@ -20,7 +20,6 @@ angular.module('kibana.controllers', []) ...@@ -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)
}) })
......
...@@ -48,6 +48,7 @@ angular.module('kibana.dashcontrol', []) ...@@ -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', []) ...@@ -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)
} }
} }
......
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