-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.9.0' into feat/6693-invalid-p-parent-of-a-div
- Loading branch information
Showing
10 changed files
with
151 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
plugins/main/public/components/common/wazuh-discover/render-columns.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import React from 'react'; | ||
import { EuiLink } from '@elastic/eui'; | ||
import { tDataGridRenderColumn } from '../data-grid'; | ||
import { getCore } from '../../../kibana-services'; | ||
import { RedirectAppLinks } from '../../../../../../src/plugins/opensearch_dashboards_react/public'; | ||
import { endpointSummary, rules } from '../../../utils/applications'; | ||
import { AppNavigate, formatUIDate } from '../../../react-services'; | ||
|
||
export const MAX_ENTRIES_PER_QUERY = 10000; | ||
|
||
const navigateTo = (ev, section, params) => { | ||
AppNavigate.navigateToModule(ev, section, params); | ||
}; | ||
|
||
const renderMitreTechnique = (technique: string) => <EuiLink | ||
onClick={e => | ||
navigateTo(e, 'overview', { | ||
tab: 'mitre', | ||
tabView: 'intelligence', | ||
tabRedirect: 'techniques', | ||
idToRedirect: technique, | ||
}) | ||
} | ||
> | ||
{technique} | ||
</EuiLink> | ||
|
||
export const wzDiscoverRenderColumns: tDataGridRenderColumn[] = [ | ||
{ | ||
id: 'agent.id', | ||
render: (value) => { | ||
if (value === '000') return value | ||
|
||
return <RedirectAppLinks application={getCore().application}> | ||
<EuiLink | ||
href={`${endpointSummary.id}#/agents?tab=welcome&agent=${value}`} | ||
> | ||
{value} | ||
</EuiLink> | ||
</RedirectAppLinks> | ||
} | ||
}, | ||
{ | ||
id: 'agent.name', | ||
render: (value, row) => { | ||
if (row.agent.id === '000') return value | ||
|
||
return <RedirectAppLinks application={getCore().application}> | ||
<EuiLink | ||
href={`${endpointSummary.id}#/agents?tab=welcome&agent=${row.agent.id}`} | ||
> | ||
{value} | ||
</EuiLink> | ||
</RedirectAppLinks> | ||
} | ||
}, | ||
{ | ||
id: 'rule.id', | ||
render: (value) => <RedirectAppLinks application={getCore().application}> | ||
<EuiLink href={`${rules.id}#/manager/?tab=rules&redirectRule=${value}`}> | ||
{value} | ||
</EuiLink> | ||
</RedirectAppLinks> | ||
}, | ||
{ | ||
id: 'rule.mitre.id', | ||
render: (value) => Array.isArray(value) ? <div style={{ display: 'flex', gap: 10 }}> | ||
{value?.map(technique => ( | ||
<div key={technique}> | ||
{renderMitreTechnique(technique)} | ||
</div> | ||
))} | ||
</div> : <div> | ||
{renderMitreTechnique(value)} | ||
</div> | ||
}, | ||
{ | ||
id: 'timestamp', | ||
render: (value) => formatUIDate(value) | ||
}, | ||
] |
Oops, something went wrong.