Merge remote-tracking branch 'origin/master' into fix-1898/watch-api-streaming

This commit is contained in:
Roman committed 2021-01-26 14:10:47 +02:00
commit 4ddd32b05f
6 files changed
+76 -24

No files matched your search

+5 -1
View File
@@ -51,6 +51,10 @@ export class Nodes extends React.Component<Props> {
if (!metrics || !metrics[1]) return <LineProgress value={0}/>;
const usage = metrics[0];
const cores = metrics[1];
const cpuUsagePercent = Math.ceil(usage * 100) / cores;
const cpuUsagePercentLabel: String = cpuUsagePercent % 1 === 0
? cpuUsagePercent.toString()
: cpuUsagePercent.toFixed(2);
return (
<LineProgress
@@ -58,7 +62,7 @@ export class Nodes extends React.Component<Props> {
value={usage}
tooltip={{
preferredPositions: TooltipPosition.BOTTOM,
children: `CPU: ${Math.ceil(usage * 100) / cores}\%, cores: ${cores}`
children: `CPU: ${cpuUsagePercentLabel}\%, cores: ${cores}`
}}
/>
);