Add all value regex to host dropdown.

This commit is contained in:
Alexander Zobnin
2017-02-11 21:50:05 +03:00
parent 77108fa05a
commit 24b63f89aa
4 changed files with 19 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ export class ZabbixQueryController extends QueryCtrl {
// Map functions for bs-typeahead
this.getGroupNames = _.bind(this.getMetricNames, this, 'groupList');
this.getHostNames = _.bind(this.getMetricNames, this, 'hostList');
this.getHostNames = _.bind(this.getMetricNames, this, 'hostList', true);
this.getApplicationNames = _.bind(this.getMetricNames, this, 'appList');
this.getItemNames = _.bind(this.getMetricNames, this, 'itemList');
@@ -111,7 +111,7 @@ export class ZabbixQueryController extends QueryCtrl {
}
// Get list of metric names for bs-typeahead directive
getMetricNames(metricList) {
getMetricNames(metricList, addAllValue) {
let metrics = _.uniq(_.map(this.metric[metricList], 'name'));
// Add template variables
@@ -119,6 +119,10 @@ export class ZabbixQueryController extends QueryCtrl {
metrics.unshift('$' + variable.name);
});
if (addAllValue) {
metrics.unshift('/.*/');
}
return metrics;
}