mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Fix CDB list export (#1423)
This commit is contained in:
parent
a8d1778fe2
commit
4c816030bd
@ -2,7 +2,7 @@
|
||||
|
||||
All notable changes to the Wazuh app project will be documented in this file.
|
||||
|
||||
## Wazuh v3.9.0 - Kibana v6.7.0 / v6.7.1 - Revision 438
|
||||
## Wazuh v3.9.0 - Kibana v6.7.0 / v6.7.1 - Revision 439
|
||||
|
||||
### Added
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "wazuh",
|
||||
"version": "3.9.0",
|
||||
"revision": "0438",
|
||||
"code": "0438-0",
|
||||
"revision": "0439",
|
||||
"code": "0439-0",
|
||||
"kibana": {
|
||||
"version": "6.7.1"
|
||||
},
|
||||
|
@ -58,7 +58,7 @@
|
||||
<td>
|
||||
<input ng-show="editingKey === item[0]" ng-disabled="loadingChange" type="text"
|
||||
class="wz-input-text" ng-model="currentList.editingNewValue"></input>
|
||||
<span ng-show="!editingKey || editingKey !== item[0]">{{item[1]}}</span>
|
||||
<span ng-show="!editingKey || editingKey !== item[0]">{{item[1] || '-'}}</span>
|
||||
</td>
|
||||
<td class="action-btn-td">
|
||||
<div ng-hide="!adminMode">
|
||||
|
@ -932,6 +932,7 @@ export class WazuhApiCtrl {
|
||||
params,
|
||||
cred
|
||||
);
|
||||
|
||||
if ((((output || {}).body || {}).data || {}).totalItems) {
|
||||
params.offset = 0;
|
||||
const { totalItems } = output.body.data;
|
||||
@ -949,7 +950,10 @@ export class WazuhApiCtrl {
|
||||
}
|
||||
|
||||
if ((((output || {}).body || {}).data || {}).totalItems) {
|
||||
const fields = req.payload.path.includes('/agents')
|
||||
const isList = req.payload.path.includes('/lists');
|
||||
const isAgents = req.payload.path.includes('/agents');
|
||||
|
||||
const fields = isAgents
|
||||
? [
|
||||
'id',
|
||||
'status',
|
||||
@ -971,10 +975,19 @@ export class WazuhApiCtrl {
|
||||
'os.uname',
|
||||
'os.version'
|
||||
]
|
||||
: isList
|
||||
? ['key', 'value']
|
||||
: Object.keys(output.body.data.items[0]);
|
||||
|
||||
const json2csvParser = new Parser({ fields });
|
||||
let csv = json2csvParser.parse(itemsArray);
|
||||
if (isList) {
|
||||
itemsArray[0].map(item => {
|
||||
if (!item.value || !item.value.length) item.value = '-';
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
let csv = json2csvParser.parse(isList ? itemsArray[0] : itemsArray);
|
||||
|
||||
for (const field of fields) {
|
||||
if (csv.includes(field)) {
|
||||
|
@ -99,5 +99,6 @@ export const KeyEquivalenece = {
|
||||
directory: 'Path(s)',
|
||||
rationale: 'Rationale',
|
||||
registry: 'Registry',
|
||||
date: 'Date'
|
||||
date: 'Date',
|
||||
value: 'Value'
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user