Resolved #28 Added host filtering by regex.

This commit is contained in:
Alexander Zobnin
2015-06-20 22:55:51 +03:00
parent fb7d90df9a
commit 27b1c62750

View File

@@ -81,6 +81,19 @@ function (angular, _, kbn) {
var self = this;
return this.itemFindQuery(groups, hosts, apps)
.then(function (items) {
// Filter hosts by regex
if (target.host.visible_name == 'All') {
if (target.hostFilter && _.every(items, _.identity.hosts)) {
var host_pattern = new RegExp(target.hostFilter);
items = _.filter(items, function (item) {
return _.some(item.hosts, function (host) {
return host_pattern.test(host.name);
});
});
}
}
if (itemnames == 'All') {
// Filter items by regex