mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 02:15:24 +00:00
Added tooltip and truncate to Wazuh tables
This commit is contained in:
parent
31870b8dbc
commit
28a78ebcce
@ -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
|
||||
}
|
||||
|
@ -17,21 +17,21 @@
|
||||
<tr ng-class="allowClick ? 'cursor-pointer' : ''" class="wz-word-wrap" ng-repeat="item in pagedItems[currentPage] | filter:{item:'!'}" ng-click="clickAction(item)">
|
||||
<td ng-repeat="key in keys" ng-if="path !== '/decoders'">
|
||||
{{
|
||||
key === 'os.name' ?
|
||||
item.os.name || '---' :
|
||||
key === 'os.version' ?
|
||||
item.os.version || '---' :
|
||||
checkIfArray(item[key.value || key]) || '---'
|
||||
nonDecoderValue(key,item) | limitTo: 25
|
||||
}}
|
||||
<span ng-if="nonDecoderValue(key,item).length > 25">...</span>
|
||||
<md-tooltip ng-if="nonDecoderValue(key,item).length > 25" md-direction="bottom" class="wz-tooltip">
|
||||
{{ nonDecoderValue(key,item) }}
|
||||
</md-tooltip>
|
||||
</td>
|
||||
<td ng-repeat="key in keys" ng-if="path === '/decoders'">
|
||||
{{
|
||||
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
|
||||
}}
|
||||
<span ng-if="decoderValue(key,item).length > 25">...</span>
|
||||
<md-tooltip ng-if="decoderValue(key,item).length > 25" md-direction="bottom" class="wz-tooltip">
|
||||
{{ decoderValue(key,item) }}
|
||||
</md-tooltip>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user