Skip to content

Commit

Permalink
Refactor AgentsWelcome component structure and layout
Browse files Browse the repository at this point in the history
  • Loading branch information
guidomodarelli committed Oct 17, 2024
1 parent 39a124a commit 39c416f
Showing 1 changed file with 61 additions and 65 deletions.
126 changes: 61 additions & 65 deletions plugins/main/public/components/common/welcome/agents-welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,69 +456,66 @@ export const AgentsWelcome = compose(
<div className='wz-module-header-agent-wrapper'>
<div className='wz-module-header-agent-main'>{title}</div>
</div>
<div className='wz-module-agents-padding-responsive'>
<EuiPage>
<EuiPageBody component='div'>
<div className='wz-module-header-nav'>
<div>
<EuiPanel
grow
paddingSize='s'
className='wz-welcome-page-agent-info'
<EuiPage>
<EuiPageBody component='div'>
<div className='wz-module-header-nav'>
<EuiPanel
grow
paddingSize='s'
className='wz-welcome-page-agent-info'
>
<AgentInfo
agent={this.props.agent}
isCondensed={false}
hideActions={true}
{...this.props}
></AgentInfo>
</EuiPanel>
</div>
<EuiFlexGroup>
<EuiFlexItem />
<EuiFlexItem
style={{
alignItems: 'flex-end',
marginTop: 10,
marginBottom: 10,
}}
>
{' '}
{/* TODO: Replace with SearchBar and replace implementation to get the time range in AgentView component*/}
<WzDatePicker condensed={true} onTimeChange={() => { }} />
</EuiFlexItem>
</EuiFlexGroup>
{(this.state.widthWindow < 1150 && (
<Fragment>
<EuiFlexGroup wrap>
<EuiFlexItem
key={'Wazuh-App-Agents-Welcome-MITRE-Top-Tactics'}
>
<AgentInfo
agent={this.props.agent}
isCondensed={false}
hideActions={true}
{...this.props}
></AgentInfo>
</EuiPanel>
</div>
</div>
<EuiFlexGroup>
<EuiFlexItem />
<EuiFlexItem
style={{
alignItems: 'flex-end',
marginTop: 10,
marginBottom: 10,
}}
>
{' '}
{/* TODO: Replace with SearchBar and replace implementation to get the time range in AgentView component*/}
<WzDatePicker condensed={true} onTimeChange={() => {}} />
</EuiFlexItem>
</EuiFlexGroup>
{(this.state.widthWindow < 1150 && (
<Fragment>
<EuiFlexGroup wrap>
<EuiFlexItem
key={'Wazuh-App-Agents-Welcome-MITRE-Top-Tactics'}
>
{this.renderMitrePanel()}
</EuiFlexItem>
{this.renderCompliancePanel()}
</EuiFlexGroup>
<EuiSpacer size='m' />
<EuiFlexGroup>
<FimEventsTable agent={this.props.agent} />
</EuiFlexGroup>
<EuiSpacer size='m' />
<EuiFlexGroup>
<EuiFlexItem
key={'Wazuh-App-Agents-Welcome-Events-Evolution'}
>
{' '}
{/* Events count evolution */}
{this.renderEventCountVisualization()}
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size='m' />
<EuiFlexGroup>
<EuiFlexItem>{this.renderSCALastScan()}</EuiFlexItem>
</EuiFlexGroup>
</Fragment>
)) || (
{this.renderMitrePanel()}
</EuiFlexItem>
{this.renderCompliancePanel()}
</EuiFlexGroup>
<EuiSpacer size='m' />
<EuiFlexGroup>
<FimEventsTable agent={this.props.agent} />
</EuiFlexGroup>
<EuiSpacer size='m' />
<EuiFlexGroup>
<EuiFlexItem
key={'Wazuh-App-Agents-Welcome-Events-Evolution'}
>
{' '}
{/* Events count evolution */}
{this.renderEventCountVisualization()}
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size='m' />
<EuiFlexGroup>
<EuiFlexItem>{this.renderSCALastScan()}</EuiFlexItem>
</EuiFlexGroup>
</Fragment>
)) || (
<Fragment>
<EuiFlexGroup>
<EuiFlexItem>
Expand Down Expand Up @@ -546,9 +543,8 @@ export const AgentsWelcome = compose(
</EuiFlexGroup>
</Fragment>
)}
</EuiPageBody>
</EuiPage>
</div>
</EuiPageBody>
</EuiPage>
</div>
</IntlProvider>
);
Expand Down

0 comments on commit 39c416f

Please sign in to comment.