Fixed triggers filtering by value (All, OK, Problems).
This commit is contained in:
@@ -343,6 +343,9 @@ export class ZabbixAPIDatasource {
|
||||
var self = this;
|
||||
var showOkEvents = annotation.showOkEvents ? [0, 1] : 1;
|
||||
|
||||
// Show all triggers
|
||||
var showTriggers = [0, 1];
|
||||
|
||||
var buildQuery = self.queryProcessor.buildTriggerQuery(this.templateSrv.replace(annotation.group),
|
||||
this.templateSrv.replace(annotation.host),
|
||||
this.templateSrv.replace(annotation.application));
|
||||
@@ -350,7 +353,7 @@ export class ZabbixAPIDatasource {
|
||||
return self.zabbixAPI.getTriggers(query.groupids,
|
||||
query.hostids,
|
||||
query.applicationids,
|
||||
true)
|
||||
showTriggers)
|
||||
.then(function(triggers) {
|
||||
|
||||
// Filter triggers by description
|
||||
|
||||
@@ -298,7 +298,7 @@ function ZabbixAPIService($q, alertSrv, zabbixAPICoreService) {
|
||||
return this.request('service.getsla', params);
|
||||
}
|
||||
|
||||
getTriggers(groupids, hostids, applicationids, showAll) {
|
||||
getTriggers(groupids, hostids, applicationids, showTriggers) {
|
||||
var params = {
|
||||
output: 'extend',
|
||||
groupids: groupids,
|
||||
@@ -318,14 +318,14 @@ function ZabbixAPIService($q, alertSrv, zabbixAPICoreService) {
|
||||
selectLastEvent: 'extend'
|
||||
};
|
||||
|
||||
if (showAll) {
|
||||
params.filter = {};
|
||||
if (showTriggers) {
|
||||
params.filter.value = showTriggers;
|
||||
}
|
||||
|
||||
return this.request('trigger.get', params);
|
||||
}
|
||||
|
||||
getEvents(objectids, from, to, showOkEvents) {
|
||||
getEvents(objectids, from, to, showEvents) {
|
||||
var params = {
|
||||
output: 'extend',
|
||||
time_from: from,
|
||||
@@ -333,7 +333,7 @@ function ZabbixAPIService($q, alertSrv, zabbixAPICoreService) {
|
||||
objectids: objectids,
|
||||
select_acknowledges: 'extend',
|
||||
selectHosts: 'extend',
|
||||
value: showOkEvents
|
||||
value: showEvents
|
||||
};
|
||||
|
||||
return this.request('event.get', params);
|
||||
|
||||
Reference in New Issue
Block a user