Commit 1d0a3660 by Torkel Ödegaard

Fixed issue with updating default data source, it required page reload to take…

Fixed issue with updating default data source, it required page reload to take effect, should not be required, now fixed, Fixes #1671
parent b8336706
# 2.0.0-RC1 (unreleased)
- [Issue #1671](https://github.com/grafana/grafana/issues/1671). Data sources: Fixed issue with changing default data source (should not require full page load to take effect, now fixed)
# 2.0.0-Beta1 (2015-03-30) # 2.0.0-Beta1 (2015-03-30)
**New features** **New features**
......
define([ define([
'angular', 'angular',
'lodash', 'config',
], ],
function (angular) { function (angular, config) {
'use strict'; 'use strict';
var module = angular.module('grafana.controllers'); var module = angular.module('grafana.controllers');
...@@ -59,7 +59,9 @@ function (angular) { ...@@ -59,7 +59,9 @@ function (angular) {
$scope.updateFrontendSettings = function() { $scope.updateFrontendSettings = function() {
backendSrv.get('/api/frontend/settings').then(function(settings) { backendSrv.get('/api/frontend/settings').then(function(settings) {
datasourceSrv.init(settings.datasources); config.datasources = settings.datasources;
config.defaultDatasource = settings.defaultDatasource;
datasourceSrv.init();
}); });
}; };
......
...@@ -11,9 +11,7 @@ function (angular, _, config) { ...@@ -11,9 +11,7 @@ function (angular, _, config) {
module.service('datasourceSrv', function($q, $injector, $rootScope) { module.service('datasourceSrv', function($q, $injector, $rootScope) {
var self = this; var self = this;
this.init = function(dsSettingList) { this.init = function() {
config.datasources = dsSettingList;
this.datasources = {}; this.datasources = {};
this.metricSources = []; this.metricSources = [];
this.annotationSources = []; this.annotationSources = [];
...@@ -77,6 +75,6 @@ function (angular, _, config) { ...@@ -77,6 +75,6 @@ function (angular, _, config) {
return this.metricSources; return this.metricSources;
}; };
this.init(config.datasources); this.init();
}); });
}); });
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