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,