Skip to content

Commit

Permalink
feat: refactor SyscollectorInventory to improve component imports and…
Browse files Browse the repository at this point in the history
… update layout for better structure and readability
  • Loading branch information
guidomodarelli committed Oct 18, 2024
1 parent 8da905e commit 6c1f9ed
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions plugins/main/public/components/agents/syscollector/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ import { API_NAME_AGENT_STATUS } from '../../../../common/constants';
import { compose } from 'redux';
import { withGuard } from '../../common/hocs';
import { PromptAgentNeverConnected } from '../prompts';
import {
NetworkInterfacesTable,
NetworkPortsTable,
NetworkSettingsTable,
ProcessesTable,
} from './components';
import { AgentInfo } from '../../common/welcome/agent-info/agents-info';
import Software from './software';
import Network from './network';
import SoftwareTab from './software';
import NetworkTab from './network';
import ProcessesTab from './processes';

export const SyscollectorInventory = compose(
withGuard(
Expand All @@ -51,27 +46,27 @@ export const SyscollectorInventory = compose(
{agent?.status === API_NAME_AGENT_STATUS.DISCONNECTED && (
<EuiFlexGroup direction='column' gutterSize='s'>
<EuiFlexItem>
<EuiCallOut
title='This agent is currently disconnected, the data may be outdated.'
iconType='iInCircle'
/>
<EuiCallOut
title='This agent is currently disconnected, the data may be outdated.'
iconType='iInCircle'
/>
</EuiFlexItem>
</EuiFlexGroup>
)}

<EuiFlexGroup direction='column' gutterSize='s'>
<EuiFlexItem>
<EuiPanel grow paddingSize='s'>
<EuiPanel grow paddingSize='s'>
<AgentInfo agent={props.agent} isCondensed={false} hideActions={true} {...props}></AgentInfo>
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer size='xxl' />

{section === 'software' && <Software agent={agent} soPlatform={soPlatform} />}
{section === 'network' && <Network agent={agent} soPlatform={soPlatform} />}
{section === 'processes' && <ProcessesTable agent={agent} soPlatform={soPlatform} />}
{section === 'software' && <SoftwareTab agent={agent} soPlatform={soPlatform} />}
{section === 'network' && <NetworkTab agent={agent} soPlatform={soPlatform} />}
{section === 'processes' && <ProcessesTab agent={agent} soPlatform={soPlatform} />}
</EuiPage>
);
});

0 comments on commit 6c1f9ed

Please sign in to comment.