diff --git a/public/directives/wazuh-table/controller.js b/public/directives/wazuh-table/controller.js index 8c7136114..74ad8b4e8 100644 --- a/public/directives/wazuh-table/controller.js +++ b/public/directives/wazuh-table/controller.js @@ -273,17 +273,33 @@ app.directive('wazuhTable', function() { return array; }; - $scope.checkIfArray = item => { - return typeof item === 'object' ? - splitArray(item) : - item == 0 ? '0' : item; - }; - + const checkIfArray = item => typeof item === 'object' ? + splitArray(item) : + item == 0 ? + '0' : + item; + $scope.$on('$destroy',() => { realTime = null; wzTableFilter.set([]); }); + $scope.nonDecoderValue = (key,item) => { + return key === 'os.name' ? + item.os.name || '---' : + key === 'os.version' ? + item.os.version || '---' : + checkIfArray(item[key.value || key]) || '---'; + }; + + $scope.decoderValue = (key,item) => { + return key === 'details.program_name' || key.value === 'details.program_name' ? + item.details.program_name || '---' : + key === 'details.order' || key.value === 'details.order' ? + item.details.order || '---' : + checkIfArray(item[key.value || key]) || '---'; + }; + }, template: template } diff --git a/public/directives/wazuh-table/template.html b/public/directives/wazuh-table/template.html index 4a81f1a21..91f5d9de8 100644 --- a/public/directives/wazuh-table/template.html +++ b/public/directives/wazuh-table/template.html @@ -17,21 +17,21 @@ {{ - key === 'os.name' ? - item.os.name || '---' : - key === 'os.version' ? - item.os.version || '---' : - checkIfArray(item[key.value || key]) || '---' + nonDecoderValue(key,item) | limitTo: 25 }} + ... + + {{ nonDecoderValue(key,item) }} + {{ - key === 'details.program_name' || key.value === 'details.program_name' ? - item.details.program_name || '---' : - key === 'details.order' || key.value === 'details.order' ? - item.details.order || '---' : - checkIfArray(item[key.value || key]) || '---' + decoderValue(key,item) | limitTo: 25 }} + ... + + {{ decoderValue(key,item) }} +