mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
mssql: pass timerange for template variable queries
This commit is contained in:
parent
9e33f8b7c4
commit
1f3fafb198
@ -107,13 +107,24 @@ export class MssqlDatasource {
|
|||||||
format: 'table',
|
format: 'table',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
queries: [interpolatedQuery],
|
||||||
|
};
|
||||||
|
|
||||||
|
if (optionalOptions && optionalOptions.range) {
|
||||||
|
if (optionalOptions.range.from) {
|
||||||
|
data['from'] = optionalOptions.range.from.valueOf().toString();
|
||||||
|
}
|
||||||
|
if (optionalOptions.range.to) {
|
||||||
|
data['to'] = optionalOptions.range.to.valueOf().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this.backendSrv
|
return this.backendSrv
|
||||||
.datasourceRequest({
|
.datasourceRequest({
|
||||||
url: '/api/tsdb/query',
|
url: '/api/tsdb/query',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: data,
|
||||||
queries: [interpolatedQuery],
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
.then(data => this.responseParser.parseMetricFindQueryResult(refId, data));
|
.then(data => this.responseParser.parseMetricFindQueryResult(refId, data));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user