Fixed zabbixTemplateFormat() error.

This commit is contained in:
Alexander Zobnin
2016-11-09 21:23:03 +03:00
parent cb7962929c
commit afe2cfc7cf

View File

@@ -9,7 +9,7 @@ import './zabbixAPI.service.js';
import './zabbixCache.service.js'; import './zabbixCache.service.js';
import './queryProcessor.service.js'; import './queryProcessor.service.js';
export class ZabbixAPIDatasource { class ZabbixAPIDatasource {
/** @ngInject */ /** @ngInject */
constructor(instanceSettings, $q, templateSrv, alertSrv, zabbixAPIService, ZabbixCachingProxy, QueryProcessor) { constructor(instanceSettings, $q, templateSrv, alertSrv, zabbixAPIService, ZabbixCachingProxy, QueryProcessor) {
@@ -449,7 +449,7 @@ function formatMetric(metricObj) {
* template variables, for example * template variables, for example
* /CPU $cpu_item.*time/ where $cpu_item is system,user,iowait * /CPU $cpu_item.*time/ where $cpu_item is system,user,iowait
*/ */
export function zabbixTemplateFormat(value) { function zabbixTemplateFormat(value) {
if (typeof value === 'string') { if (typeof value === 'string') {
return utils.escapeRegex(value); return utils.escapeRegex(value);
} }
@@ -498,6 +498,8 @@ function sequence(funcsArray) {
}; };
} }
export {ZabbixAPIDatasource, zabbixTemplateFormat};
// Fix for backward compatibility with lodash 2.4 // Fix for backward compatibility with lodash 2.4
if (!_.includes) {_.includes = _.contains;} if (!_.includes) {_.includes = _.contains;}
if (!_.keyBy) {_.keyBy = _.indexBy;} if (!_.keyBy) {_.keyBy = _.indexBy;}