Triggers query mode, allow to get active triggers count, #141
This commit is contained in:
18
dist/test/datasource-zabbix/query.controller.js
vendored
18
dist/test/datasource-zabbix/query.controller.js
vendored
@@ -60,17 +60,20 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
|
||||
_this.replaceTemplateVars = _this.datasource.replaceTemplateVars;
|
||||
_this.templateSrv = templateSrv;
|
||||
|
||||
_this.editorModes = [{ value: 'num', text: 'Metrics', mode: c.MODE_METRICS }, { value: 'text', text: 'Text', mode: c.MODE_TEXT }, { value: 'itservice', text: 'IT Services', mode: c.MODE_ITSERVICE }, { value: 'itemid', text: 'Item ID', mode: c.MODE_ITEMID }];
|
||||
_this.editorModes = [{ value: 'num', text: 'Metrics', mode: c.MODE_METRICS }, { value: 'text', text: 'Text', mode: c.MODE_TEXT }, { value: 'itservice', text: 'IT Services', mode: c.MODE_ITSERVICE }, { value: 'itemid', text: 'Item ID', mode: c.MODE_ITEMID }, { value: 'triggers', text: 'Triggers', mode: c.MODE_TRIGGERS }];
|
||||
|
||||
_this.$scope.editorMode = {
|
||||
METRICS: c.MODE_METRICS,
|
||||
TEXT: c.MODE_TEXT,
|
||||
ITSERVICE: c.MODE_ITSERVICE,
|
||||
ITEMID: c.MODE_ITEMID
|
||||
ITEMID: c.MODE_ITEMID,
|
||||
TRIGGERS: c.MODE_TRIGGERS
|
||||
};
|
||||
|
||||
_this.slaPropertyList = [{ name: "Status", property: "status" }, { name: "SLA", property: "sla" }, { name: "OK time", property: "okTime" }, { name: "Problem time", property: "problemTime" }, { name: "Down time", property: "downtimeTime" }];
|
||||
|
||||
_this.triggerSeverity = [{ val: 0, text: 'Not classified' }, { val: 1, text: 'Information' }, { val: 2, text: 'Warning' }, { val: 3, text: 'Average' }, { val: 4, text: 'High' }, { val: 5, text: 'Disaster' }];
|
||||
|
||||
// Map functions for bs-typeahead
|
||||
_this.getGroupNames = _lodash2.default.bind(_this.getMetricNames, _this, 'groupList');
|
||||
_this.getHostNames = _lodash2.default.bind(_this.getMetricNames, _this, 'hostList', true);
|
||||
@@ -110,8 +113,10 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
|
||||
'application': { 'filter': "" },
|
||||
'item': { 'filter': "" },
|
||||
'functions': [],
|
||||
'minSeverity': 3,
|
||||
'options': {
|
||||
'showDisabledItems': false
|
||||
'showDisabledItems': false,
|
||||
'countTriggers': true
|
||||
}
|
||||
};
|
||||
_lodash2.default.defaults(target, targetDefaults);
|
||||
@@ -121,8 +126,7 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
|
||||
return metricFunctions.createFuncInstance(func.def, func.params);
|
||||
});
|
||||
|
||||
if (target.mode === c.MODE_METRICS || target.mode === c.MODE_TEXT) {
|
||||
|
||||
if (target.mode === c.MODE_METRICS || target.mode === c.MODE_TEXT || target.mode === c.MODE_TRIGGERS) {
|
||||
this.initFilters();
|
||||
} else if (target.mode === c.MODE_ITSERVICE) {
|
||||
_lodash2.default.defaults(target, { slaProperty: { name: "SLA", property: "sla" } });
|
||||
@@ -131,6 +135,7 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
|
||||
};
|
||||
|
||||
_this.init();
|
||||
_this.queryOptionsText = _this.renderQueryOptionsText();
|
||||
return _this;
|
||||
}
|
||||
|
||||
@@ -340,7 +345,8 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
|
||||
key: 'renderQueryOptionsText',
|
||||
value: function renderQueryOptionsText() {
|
||||
var optionsMap = {
|
||||
showDisabledItems: "Show disabled items"
|
||||
showDisabledItems: "Show disabled items",
|
||||
countTriggers: "Count Triggers"
|
||||
};
|
||||
var options = [];
|
||||
_lodash2.default.forOwn(this.target.options, function (value, key) {
|
||||
|
||||
Reference in New Issue
Block a user