Merge pull request #85 from Sotfo/fix-query_editor_in_2.5
path fix & use dateMath instead of kbn
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
define([
|
define([
|
||||||
'angular',
|
'angular',
|
||||||
'lodash',
|
'lodash',
|
||||||
'kbn',
|
'app/core/utils/datemath',
|
||||||
'./directives',
|
'./directives',
|
||||||
'./zabbixAPIWrapper',
|
'./zabbixAPIWrapper',
|
||||||
'./helperFunctions',
|
'./helperFunctions',
|
||||||
'./queryCtrl'
|
'./queryCtrl'
|
||||||
],
|
],
|
||||||
function (angular, _, kbn) {
|
function (angular, _, dateMath) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var module = angular.module('grafana.services');
|
var module = angular.module('grafana.services');
|
||||||
@@ -94,9 +94,9 @@ function (angular, _, kbn) {
|
|||||||
ZabbixAPIDatasource.prototype.query = function(options) {
|
ZabbixAPIDatasource.prototype.query = function(options) {
|
||||||
|
|
||||||
// get from & to in seconds
|
// get from & to in seconds
|
||||||
var from = Math.ceil(kbn.parseDate(options.range.from).getTime() / 1000);
|
var from = Math.ceil(dateMath.parse(options.range.from) / 1000);
|
||||||
var to = Math.ceil(kbn.parseDate(options.range.to).getTime() / 1000);
|
var to = Math.ceil(dateMath.parse(options.range.to) / 1000);
|
||||||
var useTrendsFrom = Math.ceil(kbn.parseDate('now-' + this.trendsFrom).getTime() / 1000);
|
var useTrendsFrom = Math.ceil(dateMath.parse('now-' + this.trendsFrom) / 1000);
|
||||||
|
|
||||||
// Create request for each target
|
// Create request for each target
|
||||||
var promises = _.map(options.targets, function(target) {
|
var promises = _.map(options.targets, function(target) {
|
||||||
@@ -337,8 +337,8 @@ function (angular, _, kbn) {
|
|||||||
/////////////////
|
/////////////////
|
||||||
|
|
||||||
ZabbixAPIDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
|
ZabbixAPIDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
|
||||||
var from = Math.ceil(kbn.parseDate(rangeUnparsed.from).getTime() / 1000);
|
var from = Math.ceil(dateMath.parse(rangeUnparsed.from) / 1000);
|
||||||
var to = Math.ceil(kbn.parseDate(rangeUnparsed.to).getTime() / 1000);
|
var to = Math.ceil(dateMath.parse(rangeUnparsed.to) / 1000);
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
|
|||||||
@@ -5,12 +5,10 @@
|
|||||||
"type": "zabbix",
|
"type": "zabbix",
|
||||||
"serviceName": "ZabbixAPIDatasource",
|
"serviceName": "ZabbixAPIDatasource",
|
||||||
|
|
||||||
"module": "plugins/datasource/zabbix/datasource",
|
"module": "app/plugins/datasource/zabbix/datasource",
|
||||||
|
|
||||||
"partials": {
|
"partials": {
|
||||||
"config": "app/plugins/datasource/zabbix/partials/config.html",
|
"config": "app/plugins/datasource/zabbix/partials/config.html",
|
||||||
"query": "app/plugins/datasource/zabbix/partials/query.editor.html",
|
|
||||||
"annotations": "app/plugins/datasource/zabbix/partials/annotations.editor.html"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"username": "guest",
|
"username": "guest",
|
||||||
|
|||||||
Reference in New Issue
Block a user