From d5b43dbc5354f6a20d41f27c505481ed808b1e44 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 14 Sep 2023 16:06:03 -0400 Subject: [PATCH] Fixes #36736 - Correct memory fact on HW properties card --- .../HostDetails/DetailsTabCards/HwPropertiesCard.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js b/webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js index 13149278fc8..87d89640aec 100644 --- a/webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js +++ b/webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js @@ -10,6 +10,7 @@ import { Text, TextVariants, } from '@patternfly/react-core'; +import { number_to_human_size as NumberToHumanSize } from 'number_helpers'; import CardTemplate from 'foremanReact/components/HostDetails/Templates/CardItem/CardTemplate'; import { TranslatedPlural } from '../../../Table/components/TranslatedPlural'; import { hostIsNotRegistered } from '../hostDetailsHelpers'; @@ -43,7 +44,7 @@ const HwPropertiesCard = ({ isExpandedGlobal, hostDetails }) => { const coreSocket = facts?.['cpu::core(s)_per_socket']; const reportedFacts = propsToCamelCase(hostDetails?.reported_data || {}); const totalDisks = reportedFacts?.disksTotal; - const memory = facts?.['dmi::memory::maximum_capacity']; + const memory = facts?.['memory::memtotal']; return ( { {__('RAM')} - {memory} + {NumberToHumanSize(memory*1024, { + strip_insignificant_zeros: true, precision: 2 + })} @@ -89,7 +92,7 @@ HwPropertiesCard.propTypes = { cpuCount: PropTypes.number, cpuSockets: PropTypes.number, coreSocket: PropTypes.number, - memory: PropTypes.string, + memory: PropTypes.number, }), reported_data: PropTypes.shape({ totalDisks: PropTypes.number,