Resolved #27 - add item regex filter to query editor.
This commit is contained in:
@@ -82,7 +82,16 @@ function (angular, _, kbn) {
|
||||
return this.itemFindQuery(groups, hosts, apps)
|
||||
.then(function (items) {
|
||||
if (itemnames == 'All') {
|
||||
return items;
|
||||
|
||||
// Filter items by regex
|
||||
if (target.itemFilter) {
|
||||
var item_pattern = new RegExp(target.itemFilter);
|
||||
return _.filter(items, function (item) {
|
||||
return item_pattern.test(expandItemName(item));
|
||||
});
|
||||
} else {
|
||||
return items;
|
||||
}
|
||||
} else {
|
||||
|
||||
// Filtering items
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
</li>
|
||||
<!-- Select Item -->
|
||||
<li>
|
||||
<select style="width: 25em"
|
||||
<select style="width: 20em"
|
||||
class="tight-form-input input-medium"
|
||||
ng-change="selectItem()"
|
||||
ng-model="target.item"
|
||||
@@ -116,6 +116,15 @@
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
</li>
|
||||
<!-- Item filter -->
|
||||
<li>
|
||||
<input type="text"
|
||||
class="tight-form-input input-large"
|
||||
ng-model="target.itemFilter"
|
||||
spellcheck='false'
|
||||
placeholder="Item filter (regex)"
|
||||
ng-blur="targetBlur()">
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
Reference in New Issue
Block a user