mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
influxdb: better query-has-variable check (#37453)
This commit is contained in:
parent
0965132bff
commit
bc0ab3cc7a
@ -321,6 +321,19 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
|
|||||||
}
|
}
|
||||||
|
|
||||||
targetContainsTemplate(target: any) {
|
targetContainsTemplate(target: any) {
|
||||||
|
if (this.isFlux) {
|
||||||
|
return this.templateSrv.variableExists(target.query);
|
||||||
|
}
|
||||||
|
|
||||||
|
// now we know it is an InfluxQL query.
|
||||||
|
// it can be either a raw-query or a not-raw-query
|
||||||
|
|
||||||
|
if (target.rawQuery) {
|
||||||
|
return this.templateSrv.variableExists(target.query);
|
||||||
|
}
|
||||||
|
|
||||||
|
// now we know it is an InfluxQL not-raw-query
|
||||||
|
|
||||||
for (const group of target.groupBy) {
|
for (const group of target.groupBy) {
|
||||||
for (const param of group.params) {
|
for (const param of group.params) {
|
||||||
if (this.templateSrv.variableExists(param)) {
|
if (this.templateSrv.variableExists(param)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user