Triggers Panel: allow to hide hosts in maintenance, closes #186
This commit is contained in:
4
dist/test/datasource-zabbix/zabbix.js
vendored
4
dist/test/datasource-zabbix/zabbix.js
vendored
@@ -172,7 +172,7 @@ function ZabbixFactory(zabbixAPIService, ZabbixCachingProxy) {
|
||||
|
||||
}, {
|
||||
key: 'getTriggers',
|
||||
value: function getTriggers(groupFilter, hostFilter, appFilter, showTriggers) {
|
||||
value: function getTriggers(groupFilter, hostFilter, appFilter, showTriggers, hideHostsInMaintenance) {
|
||||
var _this5 = this;
|
||||
|
||||
var promises = [this.getGroups(groupFilter), this.getHosts(groupFilter, hostFilter), this.getApps(groupFilter, hostFilter, appFilter)];
|
||||
@@ -195,7 +195,7 @@ function ZabbixFactory(zabbixAPIService, ZabbixCachingProxy) {
|
||||
|
||||
return query;
|
||||
}).then(function (query) {
|
||||
return _this5.zabbixAPI.getTriggers(query.groupids, query.hostids, query.applicationids, showTriggers);
|
||||
return _this5.zabbixAPI.getTriggers(query.groupids, query.hostids, query.applicationids, showTriggers, hideHostsInMaintenance);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
@@ -356,7 +356,7 @@ function ZabbixAPIServiceFactory(alertSrv, zabbixAPICoreService) {
|
||||
}
|
||||
}, {
|
||||
key: 'getTriggers',
|
||||
value: function getTriggers(groupids, hostids, applicationids, showTriggers, timeFrom, timeTo) {
|
||||
value: function getTriggers(groupids, hostids, applicationids, showTriggers, hideHostsInMaintenance, timeFrom, timeTo) {
|
||||
var params = {
|
||||
output: 'extend',
|
||||
groupids: groupids,
|
||||
@@ -381,6 +381,10 @@ function ZabbixAPIServiceFactory(alertSrv, zabbixAPICoreService) {
|
||||
params.filter.value = showTriggers;
|
||||
}
|
||||
|
||||
if (hideHostsInMaintenance) {
|
||||
params.maintenance = false;
|
||||
}
|
||||
|
||||
if (timeFrom || timeTo) {
|
||||
params.lastChangeSince = timeFrom;
|
||||
params.lastChangeTill = timeTo;
|
||||
|
||||
4
dist/test/panel-triggers/module.js
vendored
4
dist/test/panel-triggers/module.js
vendored
@@ -70,6 +70,7 @@ var panelDefaults = {
|
||||
infoField: true,
|
||||
limit: 10,
|
||||
showTriggers: 'all triggers',
|
||||
hideHostsInMaintenance: false,
|
||||
sortTriggersBy: { text: 'last change', value: 'lastchange' },
|
||||
showEvents: { text: 'Problems', value: '1' },
|
||||
triggerSeverity: defaultSeverity,
|
||||
@@ -156,13 +157,14 @@ var TriggerPanelCtrl = function (_PanelCtrl) {
|
||||
_this3.zabbix = zabbix;
|
||||
var showEvents = _this3.panel.showEvents.value;
|
||||
var triggerFilter = _this3.panel.triggers;
|
||||
var hideHostsInMaintenance = _this3.panel.hideHostsInMaintenance;
|
||||
|
||||
// Replace template variables
|
||||
var groupFilter = datasource.replaceTemplateVars(triggerFilter.group.filter);
|
||||
var hostFilter = datasource.replaceTemplateVars(triggerFilter.host.filter);
|
||||
var appFilter = datasource.replaceTemplateVars(triggerFilter.application.filter);
|
||||
|
||||
var getTriggers = zabbix.getTriggers(groupFilter, hostFilter, appFilter, showEvents);
|
||||
var getTriggers = zabbix.getTriggers(groupFilter, hostFilter, appFilter, showEvents, hideHostsInMaintenance);
|
||||
return getTriggers.then(function (triggers) {
|
||||
return _lodash2.default.map(triggers, _this3.formatTrigger.bind(_this3));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user