IT-services: able to use regex for selecting of multiple services, issue #415
This commit is contained in:
30
dist/datasource-zabbix/query.controller.js
vendored
30
dist/datasource-zabbix/query.controller.js
vendored
@@ -91,11 +91,14 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './constants', './utils
|
||||
2: { value: 'text', text: 'Text', mode: c.MODE_TEXT }
|
||||
};
|
||||
|
||||
_this.slaPropertyList = [{ name: "Status", property: "status" }, { name: "SLA", property: "sla" }, { name: "OK time", property: "okTime" }, { name: "Problem time", property: "problemTime" }, { name: "Down time", property: "downtimeTime" }];
|
||||
|
||||
// Map functions for bs-typeahead
|
||||
_this.getGroupNames = _.bind(_this.getMetricNames, _this, 'groupList');
|
||||
_this.getHostNames = _.bind(_this.getMetricNames, _this, 'hostList', true);
|
||||
_this.getApplicationNames = _.bind(_this.getMetricNames, _this, 'appList');
|
||||
_this.getItemNames = _.bind(_this.getMetricNames, _this, 'itemList');
|
||||
_this.getITServices = _.bind(_this.getMetricNames, _this, 'itServiceList');
|
||||
|
||||
// Update metric suggestion when template variable was changed
|
||||
$rootScope.$on('template-variable-value-updated', function () {
|
||||
@@ -145,9 +148,8 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './constants', './utils
|
||||
|
||||
this.initFilters();
|
||||
} else if (target.mode === c.MODE_ITSERVICE) {
|
||||
this.slaPropertyList = [{ name: "Status", property: "status" }, { name: "SLA", property: "sla" }, { name: "OK time", property: "okTime" }, { name: "Problem time", property: "problemTime" }, { name: "Down time", property: "downtimeTime" }];
|
||||
this.itserviceList = [{ name: "test" }];
|
||||
this.updateITServiceList();
|
||||
_.defaults(target, { slaProperty: { name: "SLA", property: "sla" } });
|
||||
this.suggestITServices();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -230,6 +232,16 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './constants', './utils
|
||||
return items;
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'suggestITServices',
|
||||
value: function suggestITServices() {
|
||||
var _this6 = this;
|
||||
|
||||
return this.zabbix.getITService().then(function (itservices) {
|
||||
_this6.metric.itServiceList = itservices;
|
||||
return itservices;
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'isRegex',
|
||||
value: function isRegex(str) {
|
||||
@@ -259,11 +271,11 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './constants', './utils
|
||||
}, {
|
||||
key: 'isContainsVariables',
|
||||
value: function isContainsVariables() {
|
||||
var _this6 = this;
|
||||
var _this7 = this;
|
||||
|
||||
return _.some(['group', 'host', 'application'], function (field) {
|
||||
if (_this6.target[field] && _this6.target[field].filter) {
|
||||
return utils.isTemplateVariable(_this6.target[field].filter, _this6.templateSrv.variables);
|
||||
if (_this7.target[field] && _this7.target[field].filter) {
|
||||
return utils.isTemplateVariable(_this7.target[field].filter, _this7.templateSrv.variables);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -360,11 +372,11 @@ System.register(['app/plugins/sdk', 'angular', 'lodash', './constants', './utils
|
||||
}, {
|
||||
key: 'updateITServiceList',
|
||||
value: function updateITServiceList() {
|
||||
var _this7 = this;
|
||||
var _this8 = this;
|
||||
|
||||
this.zabbix.getITService().then(function (iteservices) {
|
||||
_this7.itserviceList = [];
|
||||
_this7.itserviceList = _this7.itserviceList.concat(iteservices);
|
||||
_this8.itserviceList = [];
|
||||
_this8.itserviceList = _this8.itserviceList.concat(iteservices);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user