diff --git a/CHANGELOG.md b/CHANGELOG.md index 599e239464..b2432582b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to the Wazuh app project will be documented in this file. ### Changed +- Refined the layout of the agent details view [#7193](https://github.com/wazuh/wazuh-dashboard-plugins/issues/7193) - Changed the width of the command column, relocate argvs column and change the width of the rest of the columns in the table processes. [#7195](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7195) ## Wazuh v4.10.0 - OpenSearch Dashboards 2.16.0 - Revision 03 diff --git a/plugins/main/public/components/agents/__snapshots__/agent-status.test.tsx.snap b/plugins/main/public/components/agents/__snapshots__/agent-status.test.tsx.snap index 281620631e..6e7375e505 100644 --- a/plugins/main/public/components/agents/__snapshots__/agent-status.test.tsx.snap +++ b/plugins/main/public/components/agents/__snapshots__/agent-status.test.tsx.snap @@ -44,7 +44,7 @@ exports[`AgentStatus component Renders status indicator with the its color and t active
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
( + <> + {getPlatformIcon(value)} + {getOsName(value)} + + ), }, { key: 'cpu', diff --git a/plugins/main/public/components/common/platform/index.tsx b/plugins/main/public/components/common/platform/index.tsx new file mode 100644 index 0000000000..a3b70d9929 --- /dev/null +++ b/plugins/main/public/components/common/platform/index.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import { WAZUH_AGENTS_OS_TYPE } from '../../../../common/constants'; +import { getAgentOSType } from '../../../react-services'; +import { Agent } from '../../endpoints-summary/types'; + +export const getPlatformIcon = (agent?: Agent): React.JSX.Element => { + let icon = ''; + const osType = getAgentOSType(agent); + if (osType === WAZUH_AGENTS_OS_TYPE.DARWIN) { + icon = 'apple'; + } else if ( + [WAZUH_AGENTS_OS_TYPE.WINDOWS, WAZUH_AGENTS_OS_TYPE.LINUX].includes(osType) + ) { + icon = osType; + } + + if (icon) { + return ( + + ); + } + return <>; +}; + +export const getOsName = (agent?: Agent) => { + const { name, version } = agent?.os || {}; + + if (!name && !version) { + return '-'; + } + + if (!version) { + return name; + } + + if (!name) { + return version; + } + + return `${name} ${version}`; +}; diff --git a/plugins/main/public/components/common/ribbon/ribbon-item.scss b/plugins/main/public/components/common/ribbon/ribbon-item.scss index bf543a6a40..ae0e83a0f0 100644 --- a/plugins/main/public/components/common/ribbon/ribbon-item.scss +++ b/plugins/main/public/components/common/ribbon/ribbon-item.scss @@ -2,3 +2,9 @@ font-size: 12px; font-family: sans-serif; } + +@media (max-width: 767px) { + .wz-ribbon-item { + max-width: none !important; + } +} diff --git a/plugins/main/public/components/common/ribbon/ribbon-item.tsx b/plugins/main/public/components/common/ribbon/ribbon-item.tsx index 29741c8a6b..b3fbb2a5f8 100644 --- a/plugins/main/public/components/common/ribbon/ribbon-item.tsx +++ b/plugins/main/public/components/common/ribbon/ribbon-item.tsx @@ -1,13 +1,12 @@ import { EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import React from 'react'; -import { WAZUH_AGENTS_OS_TYPE } from '../../../../common/constants'; import { AgentStatus } from '../../agents/agent-status'; import { Agent } from '../../endpoints-summary/types'; import { WzStat } from '../../wz-stat'; import { GroupTruncate } from '../util/agent-group-truncate'; import WzTextWithTooltipIfTruncated from '../wz-text-with-tooltip-if-truncated'; import './ribbon-item.scss'; -import { getAgentOSType } from '../../../react-services'; +import { TAgentStatus } from '../../../../common/services/wz_agent_status'; const FONT_SIZE = 12; @@ -23,7 +22,8 @@ export type IRibbonItem