Skip to content

Commit

Permalink
fix cores translation value
Browse files Browse the repository at this point in the history
  • Loading branch information
zherman0 committed Oct 28, 2021
1 parent ef8208d commit 8c40b52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/packages/console-app/locales/en/console-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
"Terminal": "Terminal",
"Pods": "Pods",
"Labels": "Labels",
"{{formattedCores}} cores / {{totalCores}} cores": "{{formattedCores}} cores / {{totalCores}} cores",
"Nodes": "Nodes",
"Ready": "Ready",
"Not Ready": "Not Ready",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ const NodesTableRow: React.FC<RowFunctionArgs<NodeKind>> = ({
obj: node,
customData: { tableColumns },
}) => {
const { t } = useTranslation();
const metrics = useSelector(({ UI }) => UI.getIn(['metrics', 'node']));
const nodeName = getName(node);
const nodeUID = getUID(node);
Expand All @@ -246,7 +247,10 @@ const NodesTableRow: React.FC<RowFunctionArgs<NodeKind>> = ({
const totalCores = metrics?.totalCPU?.[nodeName];
const cpu =
Number.isFinite(cores) && Number.isFinite(totalCores)
? `${formatCores(cores)} cores / ${totalCores} cores`
? t('console-app~{{formattedCores}} cores / {{totalCores}} cores', {
formattedCores: formatCores(cores),
totalCores,
})
: '-';
const usedStrg = metrics?.usedStorage?.[nodeName];
const totalStrg = metrics?.totalStorage?.[nodeName];
Expand Down

0 comments on commit 8c40b52

Please sign in to comment.