|
@@ -21,6 +21,7 @@ export class DashboardCtrl {
|
|
|
dynamicDashboardSrv,
|
|
dynamicDashboardSrv,
|
|
|
dashboardViewStateSrv,
|
|
dashboardViewStateSrv,
|
|
|
contextSrv,
|
|
contextSrv,
|
|
|
|
|
+ alertSrv,
|
|
|
$timeout) {
|
|
$timeout) {
|
|
|
|
|
|
|
|
$scope.editor = { index: 0 };
|
|
$scope.editor = { index: 0 };
|
|
@@ -29,11 +30,15 @@ export class DashboardCtrl {
|
|
|
var resizeEventTimeout;
|
|
var resizeEventTimeout;
|
|
|
|
|
|
|
|
$scope.setupDashboard = function(data) {
|
|
$scope.setupDashboard = function(data) {
|
|
|
- var dashboard = dashboardSrv.create(data.dashboard, data.meta);
|
|
|
|
|
- dashboardSrv.setCurrent(dashboard);
|
|
|
|
|
-
|
|
|
|
|
- // init services
|
|
|
|
|
- timeSrv.init(dashboard);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ var dashboard = dashboardSrv.create(data.dashboard, data.meta);
|
|
|
|
|
+ dashboardSrv.setCurrent(dashboard);
|
|
|
|
|
+
|
|
|
|
|
+ // init services
|
|
|
|
|
+ timeSrv.init(dashboard);
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ $scope.appEvent("alert-error", ['Dashboard init failed', err.message]);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// template values service needs to initialize completely before
|
|
// template values service needs to initialize completely before
|
|
|
// the rest of the dashboard can load
|
|
// the rest of the dashboard can load
|