datasource: implement itemid query mode

This commit is contained in:
Alexander Zobnin
2017-07-25 18:40:13 +03:00
parent a48da2cda6
commit fc1748a087
24 changed files with 373 additions and 214 deletions

View File

@@ -217,16 +217,19 @@ function ZabbixAPIServiceFactory(alertSrv, zabbixAPICoreService) {
params.filter.value_type = [1, 2, 4];
}
return this.request('item.get', params).then(expandItems);
return this.request('item.get', params).then(utils.expandItems);
}
}, {
key: 'getItemsByIDs',
value: function getItemsByIDs(itemids) {
var params = {
itemids: itemids,
output: ['name', 'key_', 'value_type', 'hostid', 'status', 'state'],
webitems: true,
selectHosts: ['hostid', 'name']
};
function expandItems(items) {
_lodash2.default.forEach(items, function (item) {
item.item = item.name;
item.name = utils.expandItemName(item.item, item.key_);
return item;
});
return items;
}
return this.request('item.get', params).then(utils.expandItems);
}
}, {
key: 'getMacros',