diff --git a/zabbix/datasource.js b/zabbix/datasource.js index ca0008f..93e81ca 100644 --- a/zabbix/datasource.js +++ b/zabbix/datasource.js @@ -341,8 +341,15 @@ function (angular, _, dateMath) { var to = Math.ceil(dateMath.parse(options.rangeRaw.to) / 1000); var self = this; + // Remove events below the chose severity + var severities = []; + for (var i = 5; i >= options.annotation.minseverity; i--) { + severities.push(i); + } var params = { - output: ['triggerid', 'description'], + output: ['triggerid', 'description', 'priority'], + preservekeys: 1, + filter: { 'priority': severities }, search: { 'description': options.annotation.trigger }, @@ -359,7 +366,7 @@ function (angular, _, dateMath) { return this.zabbixAPI.performZabbixAPIRequest('trigger.get', params) .then(function (result) { if(result) { - var objects = _.indexBy(result, 'triggerid'); + var objects = result; var params = { output: 'extend', time_from: from, @@ -385,6 +392,9 @@ function (angular, _, dateMath) { title += Number(e.value) ? 'Problem' : 'OK'; _.each(result, function(e) { + // Hide acknowledged events + if (e.acknowledges.length > 0 && options.annotation.showAcknowledged) { return; } + var formatted_acknowledges = zabbixHelperSrv.formatAcknowledges(e.acknowledges); events.push({ annotation: options.annotation, diff --git a/zabbix/partials/annotations.editor.html b/zabbix/partials/annotations.editor.html index bc7fea0..7dc8fb8 100644 --- a/zabbix/partials/annotations.editor.html +++ b/zabbix/partials/annotations.editor.html @@ -21,6 +21,11 @@ +