Fixed directives.

This commit is contained in:
Alexander Zobnin
2016-03-16 21:41:19 +03:00
parent 816870136c
commit 17e8529127
3 changed files with 20 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
import _ from 'lodash'; import _ from 'lodash';
import * as dateMath from 'app/core/utils/datemath'; import * as dateMath from 'app/core/utils/datemath';
import * as utils from './utils'; import * as utils from './utils';
import metricFunctions from './metricFunctions'; import * as metricFunctions from './metricFunctions';
import './zabbixAPI.service.js'; import './zabbixAPI.service.js';
import './zabbixCache.service.js'; import './zabbixCache.service.js';
import './queryProcessor.service.js'; import './queryProcessor.service.js';

View File

@@ -189,22 +189,20 @@ class FuncInstance {
} }
} }
export default { export function createFuncInstance(funcDef, params) {
createFuncInstance: function(funcDef, params) { if (_.isString(funcDef)) {
if (_.isString(funcDef)) { if (!index[funcDef]) {
if (!index[funcDef]) { throw { message: 'Method not found ' + name };
throw { message: 'Method not found ' + name };
}
funcDef = index[funcDef];
} }
return new FuncInstance(funcDef, params); funcDef = index[funcDef];
},
getFuncDef: function(name) {
return index[name];
},
getCategories: function() {
return categories;
} }
}; return new FuncInstance(funcDef, params);
}
export function getFuncDef(name) {
return index[name];
}
export function getCategories() {
return categories;
}

View File

@@ -1,7 +1,10 @@
import {QueryCtrl} from 'app/plugins/sdk'; import {QueryCtrl} from 'app/plugins/sdk';
import _ from 'lodash'; import _ from 'lodash';
import * as utils from './utils'; import * as utils from './utils';
import metricFunctions from './metricFunctions'; import * as metricFunctions from './metricFunctions';
import './add-metric-function.directive';
import './metric-function-editor.directive';
export class ZabbixQueryController extends QueryCtrl { export class ZabbixQueryController extends QueryCtrl {