mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 07:35:45 -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',
|
||||
};
|
||||
|
||||
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
|
||||
.datasourceRequest({
|
||||
url: '/api/tsdb/query',
|
||||
method: 'POST',
|
||||
data: {
|
||||
queries: [interpolatedQuery],
|
||||
},
|
||||
data: data,
|
||||
})
|
||||
.then(data => this.responseParser.parseMetricFindQueryResult(refId, data));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user