refactor: collapse options in getTriggers()

This commit is contained in:
Alexander Zobnin
2017-06-08 14:44:41 +03:00
parent 5de016dd80
commit 889f33f45f
16 changed files with 61 additions and 28 deletions

View File

@@ -520,9 +520,12 @@ System.register(['lodash', 'app/core/utils/datemath', './utils', './migrations',
var showOkEvents = annotation.showOkEvents ? c.SHOW_ALL_EVENTS : c.SHOW_OK_EVENTS;
// Show all triggers
var showTriggers = c.SHOW_ALL_TRIGGERS;
var triggersOptions = {
showTriggers: c.SHOW_ALL_TRIGGERS,
hideHostsInMaintenance: false
};
var getTriggers = this.zabbix.getTriggers(this.replaceTemplateVars(annotation.group, {}), this.replaceTemplateVars(annotation.host, {}), this.replaceTemplateVars(annotation.application, {}), showTriggers);
var getTriggers = this.zabbix.getTriggers(this.replaceTemplateVars(annotation.group, {}), this.replaceTemplateVars(annotation.host, {}), this.replaceTemplateVars(annotation.application, {}), triggersOptions);
return getTriggers.then(function (triggers) {

File diff suppressed because one or more lines are too long

View File

@@ -170,7 +170,7 @@ System.register(['angular', 'lodash', './utils', './zabbixAPI.service.js', './za
}
}, {
key: 'getTriggers',
value: function getTriggers(groupFilter, hostFilter, appFilter, showTriggers, hideHostsInMaintenance) {
value: function getTriggers(groupFilter, hostFilter, appFilter, options) {
var _this5 = this;
var promises = [this.getGroups(groupFilter), this.getHosts(groupFilter, hostFilter), this.getApps(groupFilter, hostFilter, appFilter)];
@@ -193,7 +193,7 @@ System.register(['angular', 'lodash', './utils', './zabbixAPI.service.js', './za
return query;
}).then(function (query) {
return _this5.zabbixAPI.getTriggers(query.groupids, query.hostids, query.applicationids, showTriggers, hideHostsInMaintenance);
return _this5.zabbixAPI.getTriggers(query.groupids, query.hostids, query.applicationids, options);
});
}
}]);

File diff suppressed because one or more lines are too long

View File

@@ -306,7 +306,13 @@ System.register(['angular', 'lodash', './utils', './zabbixAPICore.service'], fun
}
}, {
key: 'getTriggers',
value: function getTriggers(groupids, hostids, applicationids, showTriggers, hideHostsInMaintenance, timeFrom, timeTo) {
value: function getTriggers(groupids, hostids, applicationids, options) {
var showTriggers = options.showTriggers,
hideHostsInMaintenance = options.hideHostsInMaintenance,
timeFrom = options.timeFrom,
timeTo = options.timeTo;
var params = {
output: 'extend',
groupids: groupids,

File diff suppressed because one or more lines are too long