mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Revert "support panel repeat for datasource template variable (#7711)"
This reverts commit 554f972a25
.
This commit is contained in:
parent
dd800fd14d
commit
48c4e549f5
@ -14,12 +14,12 @@ function (angular, _, coreModule, config) {
|
||||
this.datasources = {};
|
||||
};
|
||||
|
||||
this.get = function(name, scopedDsVars) {
|
||||
this.get = function(name) {
|
||||
if (!name) {
|
||||
return this.get(config.defaultDatasource);
|
||||
}
|
||||
|
||||
name = templateSrv.replace(name, scopedDsVars || {});
|
||||
name = templateSrv.replace(name);
|
||||
|
||||
if (name === 'default') {
|
||||
return this.get(config.defaultDatasource);
|
||||
|
@ -92,7 +92,7 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
|
||||
// load datasource service
|
||||
this.setTimeQueryStart();
|
||||
this.datasourceSrv.get(this.panel.datasource, this.panel.scopedVars)
|
||||
this.datasourceSrv.get(this.panel.datasource)
|
||||
.then(this.updateTimeRange.bind(this))
|
||||
.then(this.issueQueries.bind(this))
|
||||
.then(this.handleQueryResult.bind(this))
|
||||
|
@ -10,8 +10,6 @@ export class DatasourceVariable implements Variable {
|
||||
query: string;
|
||||
options: any;
|
||||
current: any;
|
||||
multi: boolean;
|
||||
includeAll: boolean;
|
||||
refresh: any;
|
||||
|
||||
defaults = {
|
||||
@ -23,8 +21,6 @@ export class DatasourceVariable implements Variable {
|
||||
regex: '',
|
||||
options: [],
|
||||
query: '',
|
||||
multi: false,
|
||||
includeAll: false,
|
||||
refresh: 1,
|
||||
};
|
||||
|
||||
@ -75,16 +71,9 @@ export class DatasourceVariable implements Variable {
|
||||
}
|
||||
|
||||
this.options = options;
|
||||
if (this.includeAll) {
|
||||
this.addAllOption();
|
||||
}
|
||||
return this.variableSrv.validateVariableSelectionState(this);
|
||||
}
|
||||
|
||||
addAllOption() {
|
||||
this.options.unshift({text: 'All', value: "$__all"});
|
||||
}
|
||||
|
||||
dependsOn(variable) {
|
||||
if (this.regex) {
|
||||
return containsVariable(this.regex, variable.name);
|
||||
@ -97,9 +86,6 @@ export class DatasourceVariable implements Variable {
|
||||
}
|
||||
|
||||
getValueForUrl() {
|
||||
if (this.current.text === 'All') {
|
||||
return 'All';
|
||||
}
|
||||
return this.current.value;
|
||||
}
|
||||
}
|
||||
@ -107,6 +93,5 @@ export class DatasourceVariable implements Variable {
|
||||
variableTypes['datasource'] = {
|
||||
name: 'Datasource',
|
||||
ctor: DatasourceVariable,
|
||||
supportsMulti: true,
|
||||
description: 'Enabled you to dynamically switch the datasource for multiple panels',
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user