mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(grafana datasource): fixed the built in test data source, fixes #2795
This commit is contained in:
parent
792b194d0e
commit
63665dccae
@ -1,10 +1,9 @@
|
|||||||
define([
|
define([
|
||||||
'angular',
|
'angular',
|
||||||
'lodash',
|
'lodash',
|
||||||
'kbn',
|
|
||||||
'./directives',
|
'./directives',
|
||||||
],
|
],
|
||||||
function (angular, _, kbn) {
|
function (angular, _) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var module = angular.module('grafana.services');
|
var module = angular.module('grafana.services');
|
||||||
@ -15,11 +14,11 @@ function (angular, _, kbn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GrafanaDatasource.prototype.query = function(options) {
|
GrafanaDatasource.prototype.query = function(options) {
|
||||||
// get from & to in seconds
|
return backendSrv.get('/api/metrics/test', {
|
||||||
var from = kbn.parseDate(options.range.from).getTime();
|
from: options.range.from.valueOf(),
|
||||||
var to = kbn.parseDate(options.range.to).getTime();
|
to: options.range.to.valueOf(),
|
||||||
|
maxDataPoints: options.maxDataPoints
|
||||||
return backendSrv.get('/api/metrics/test', { from: from, to: to, maxDataPoints: options.maxDataPoints });
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
GrafanaDatasource.prototype.metricFindQuery = function() {
|
GrafanaDatasource.prototype.metricFindQuery = function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user