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)
**New features**
......
define([
'angular',
'lodash',
'config',
],
function (angular) {
function (angular, config) {
'use strict';
var module = angular.module('grafana.controllers');
......@@ -59,7 +59,9 @@ function (angular) {
$scope.updateFrontendSettings = function() {
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) {
module.service('datasourceSrv', function($q, $injector, $rootScope) {
var self = this;
this.init = function(dsSettingList) {
config.datasources = dsSettingList;
this.init = function() {
this.datasources = {};
this.metricSources = [];
this.annotationSources = [];
......@@ -77,6 +75,6 @@ function (angular, _, config) {
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