mirror of
https://github.com/grafana/grafana.git
synced 2025-02-04 12:41:12 -06:00
Handle errors when loading dashboard with template variables that query data sources that cannot be found
This commit is contained in:
parent
8f73328e25
commit
646298f5c5
@ -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
|
||||
}
|
||||
|
@ -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]);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user