mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed issue with updating default data source, it required page reload to take effect, should not be required, now fixed, Fixes #1671
This commit is contained in:
parent
b83367063e
commit
1d0a3660bd
@ -1,3 +1,8 @@
|
||||
# 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**
|
||||
|
@ -1,8 +1,8 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user