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

@@ -91,7 +91,7 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './utils', './metricFun
// Map functions for bs-typeahead // Map functions for bs-typeahead
_this.getGroupNames = _.bind(_this.getMetricNames, _this, 'groupList'); _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.getApplicationNames = _.bind(_this.getMetricNames, _this, 'appList');
_this.getItemNames = _.bind(_this.getMetricNames, _this, 'itemList'); _this.getItemNames = _.bind(_this.getMetricNames, _this, 'itemList');
@@ -161,7 +161,7 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './utils', './metricFun
} }
}, { }, {
key: 'getMetricNames', key: 'getMetricNames',
value: function getMetricNames(metricList) { value: function getMetricNames(metricList, addAllValue) {
var metrics = _.uniq(_.map(this.metric[metricList], 'name')); var metrics = _.uniq(_.map(this.metric[metricList], 'name'));
// Add template variables // Add template variables
@@ -169,6 +169,10 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './utils', './metricFun
metrics.unshift('$' + variable.name); metrics.unshift('$' + variable.name);
}); });
if (addAllValue) {
metrics.unshift('/.*/');
}
return metrics; return metrics;
} }
}, { }, {

File diff suppressed because one or more lines are too long

View File

@@ -68,7 +68,7 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
// Map functions for bs-typeahead // Map functions for bs-typeahead
_this.getGroupNames = _lodash2.default.bind(_this.getMetricNames, _this, 'groupList'); _this.getGroupNames = _lodash2.default.bind(_this.getMetricNames, _this, 'groupList');
_this.getHostNames = _lodash2.default.bind(_this.getMetricNames, _this, 'hostList'); _this.getHostNames = _lodash2.default.bind(_this.getMetricNames, _this, 'hostList', true);
_this.getApplicationNames = _lodash2.default.bind(_this.getMetricNames, _this, 'appList'); _this.getApplicationNames = _lodash2.default.bind(_this.getMetricNames, _this, 'appList');
_this.getItemNames = _lodash2.default.bind(_this.getMetricNames, _this, 'itemList'); _this.getItemNames = _lodash2.default.bind(_this.getMetricNames, _this, 'itemList');
@@ -141,7 +141,7 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
}, { }, {
key: 'getMetricNames', key: 'getMetricNames',
value: function getMetricNames(metricList) { value: function getMetricNames(metricList, addAllValue) {
var metrics = _lodash2.default.uniq(_lodash2.default.map(this.metric[metricList], 'name')); var metrics = _lodash2.default.uniq(_lodash2.default.map(this.metric[metricList], 'name'));
// Add template variables // Add template variables
@@ -149,6 +149,10 @@ var ZabbixQueryController = exports.ZabbixQueryController = function (_QueryCtrl
metrics.unshift('$' + variable.name); metrics.unshift('$' + variable.name);
}); });
if (addAllValue) {
metrics.unshift('/.*/');
}
return metrics; return metrics;
} }
}, { }, {

View File

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