diff --git a/pkg/middleware/util.go b/pkg/middleware/util.go index 2d7d9739ead..0823e4de4bf 100644 --- a/pkg/middleware/util.go +++ b/pkg/middleware/util.go @@ -11,6 +11,7 @@ func Gziper() macaron.Handler { return func(ctx *macaron.Context) { requestPath := ctx.Req.URL.RequestURI() + // ignore datasource proxy requests if strings.HasPrefix(requestPath, "/api/datasources/proxy") { return } diff --git a/public/app/features/dashboard/dashboardCtrl.js b/public/app/features/dashboard/dashboardCtrl.js index 4a1c38d0c5f..ff915a7dbf2 100644 --- a/public/app/features/dashboard/dashboardCtrl.js +++ b/public/app/features/dashboard/dashboardCtrl.js @@ -45,7 +45,7 @@ function (angular, $, config) { // template values service needs to initialize completely before // the rest of the dashboard can load - templateValuesSrv.init(dashboard).then(function() { + templateValuesSrv.init(dashboard).finally(function() { $scope.dashboard = dashboard; $scope.dashboardMeta = dashboard.meta; $scope.dashboardViewState = dashboardViewStateSrv.create($scope); @@ -57,6 +57,9 @@ function (angular, $, config) { $scope.setWindowTitleAndTheme(); $scope.appEvent("dashboard-loaded", $scope.dashboard); + }).catch(function(err) { + console.log('Failed to initialize dashboard template variables, error: ', err); + $scope.appEvent("alert-error", ['Dashboard init failed', 'Template variables could not be initialized: ' + err.message]); }); }; diff --git a/public/app/plugins/datasource/grafana/datasource.js b/public/app/plugins/datasource/grafana/datasource.js index 875b7809799..b0beea99e53 100644 --- a/public/app/plugins/datasource/grafana/datasource.js +++ b/public/app/plugins/datasource/grafana/datasource.js @@ -31,6 +31,10 @@ function (angular, _, kbn) { return backendSrv.get('/api/metrics/test', { from: from, to: to, maxDataPoints: options.maxDataPoints }); }; + GrafanaDatasource.prototype.metricFindQuery = function() { + return $q.when([]); + }; + GrafanaDatasource.prototype.starDashboard = function(dashId) { return backendSrv.post('/api/user/stars/dashboard/' + dashId); };