diff --git a/CHANGELOG.md b/CHANGELOG.md index e7fcab3582..5fd36ef3a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fix Strange box shadow in Export popup panel in Managment > Groups [#2886](https://github.com/wazuh/wazuh-kibana-app/issues/2886) - Fixed wrong command on alert when data folder does not exist [#2938](https://github.com/wazuh/wazuh-kibana-app/pull/2938) - Fix agents table OS field sorting: Changes agents table field `os_name` to `os.name,os.version` to make it sortable. [#2939](https://github.com/wazuh/wazuh-kibana-app/pull/2939) +- Fixed diff parsed datetime between agent detail and agents table [#2940](https://github.com/wazuh/wazuh-kibana-app/pull/2940) ## Wazuh v4.0.4 - Kibana 7.10.0 , 7.10.2 - Revision 4017 diff --git a/public/components/common/welcome/agents-info.js b/public/components/common/welcome/agents-info.js index 6a4c5fd6cd..db6f1c0b3a 100644 --- a/public/components/common/welcome/agents-info.js +++ b/public/components/common/welcome/agents-info.js @@ -19,6 +19,7 @@ import { EuiBadge } from '@elastic/eui'; import { WzRequest } from '../../../react-services/wz-request'; +import { TimeService } from '../../../react-services/time-service'; import WzTextWithTooltipIfTruncated from '../wz-text-with-tooltip-if-truncated'; import { WzStat } from '../../wz-stat'; @@ -29,6 +30,7 @@ export class AgentInfo extends Component { super(props); this.state = {}; + this.timeService = TimeService; } async componentDidMount() { @@ -155,11 +157,22 @@ export class AgentInfo extends Component { return stats; } + + parseDateTime(datetime){ + try { + return this.timeService.offset(datetime); + } catch (error) { + return datetime; + } + } + render() { const { agent } = this.props; let arrayStats; + + if (this.props.isCondensed) { arrayStats = [ { title: agent.id, description: 'ID', style: { maxWidth: 100 } }, @@ -183,8 +196,15 @@ export class AgentInfo extends Component { description: 'Operating system', style: {} }, - { title: agent.dateAdd, description: 'Registration date', style: { maxWidth: 150 } }, - { title: agent.lastKeepAlive, description: 'Last keep alive', style: { maxWidth: 150 } }, + { + title: this.parseDateTime(agent.dateAdd), + description: 'Registration date', + style: { maxWidth: 150 } }, + { + title: this.parseDateTime(agent.lastKeepAlive), + description: 'Last keep alive', + style: { maxWidth: 150 } + }, ]; }