Skip to content

Commit

Permalink
Fixes #36736 - Correct memory fact on HW properties card
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1984 committed Sep 21, 2023
1 parent 7089672 commit d5b43db
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 (
<CardTemplate
Expand Down Expand Up @@ -71,7 +72,9 @@ const HwPropertiesCard = ({ isExpandedGlobal, hostDetails }) => {
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>{__('RAM')}</DescriptionListTerm>
<DescriptionListDescription>{memory}</DescriptionListDescription>
<DescriptionListDescription>{NumberToHumanSize(memory*1024, {

Check failure on line 75 in webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js

View workflow job for this annotation

GitHub Actions / build

Operator '*' must be spaced
strip_insignificant_zeros: true, precision: 2

Check failure on line 76 in webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 12 spaces but found 10

Check failure on line 76 in webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
})}</DescriptionListDescription>

Check failure on line 77 in webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 10 spaces but found 8

Check failure on line 77 in webpack/components/extensions/HostDetails/DetailsTabCards/HwPropertiesCard.js

View workflow job for this annotation

GitHub Actions / build

Closing tag of a multiline JSX expression must be on its own line
</DescriptionListGroup>
<DescriptionListGroup>
<HostDisks totalDisks={totalDisks} />
Expand All @@ -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,
Expand Down

0 comments on commit d5b43db

Please sign in to comment.