mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(templating): more work on new variable handling code, #6048
This commit is contained in:
@@ -11,11 +11,12 @@ export class DatasourceVariable implements Variable {
|
||||
options: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private model, private datasourceSrv) {
|
||||
constructor(private model, private datasourceSrv, private variableSrv) {
|
||||
_.extend(this, model);
|
||||
}
|
||||
|
||||
setValue(option) {
|
||||
this.variableSrv.setOptionAsCurrent(this, option);
|
||||
}
|
||||
|
||||
updateOptions() {
|
||||
@@ -48,9 +49,13 @@ export class DatasourceVariable implements Variable {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
dependsOn(variableName) {
|
||||
dependsOn(variable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setValueFromUrl(urlValue) {
|
||||
return this.variableSrv.setOptionFromUrl(this, urlValue);
|
||||
}
|
||||
}
|
||||
|
||||
variableConstructorMap['datasource'] = DatasourceVariable;
|
||||
|
||||
Reference in New Issue
Block a user