Commit 1f3fafb1 by Paresh

mssql: pass timerange for template variable queries

parent 9e33f8b7
...@@ -107,13 +107,24 @@ export class MssqlDatasource { ...@@ -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));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment