Show only needed item types in query editor.

This commit is contained in:
Alexander Zobnin
2016-01-28 22:14:35 +03:00
parent 308fef223e
commit 15f7134d9e
2 changed files with 25 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ define([
return metricFunctions.createFuncInstance(func.def, func.params);
});
if ($scope.target.mode ===0 ||
if ($scope.target.mode === 0 ||
$scope.target.mode === 2) {
$scope.downsampleFunctionList = [
@@ -83,11 +83,12 @@ define([
};
$scope.getMetricsFromCache = function () {
var item_type = $scope.editorModes[$scope.target.mode];
$scope.metric = {
groupList: zabbixCache.getGroups(),
hostList: zabbixCache.getHosts(),
applicationList: zabbixCache.getApplications(),
itemList: zabbixCache.getItems()
itemList: zabbixCache.getItems(item_type)
};
};
@@ -305,6 +306,12 @@ define([
$scope.functionChanged = function() {};
$scope.editorModes = {
0: 'num',
1: 'itservice',
2: 'text'
};
/**
* Switch query editor to specified mode.
* Modes: