Add all value regex to host dropdown.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user