File tree Expand file tree Collapse file tree 2 files changed +3
-19
lines changed
src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ import i18n from '../../../../../components/MemoryViewer/i18n';
66import { getMemorySegments } from '../../../../../components/MemoryViewer/utils' ;
77import { ProgressWrapper } from '../../../../../components/ProgressWrapper' ;
88import type { TMemoryStats } from '../../../../../types/api/nodes' ;
9- import { formatBytes } from '../../../../../utils/bytesParsers' ;
109import { cn } from '../../../../../utils/cn' ;
10+ import { formatStorageValuesToGb } from '../../../../../utils/dataFormatters/dataFormatters' ;
1111
1212import { MemorySegmentItem } from './MemorySegmentItem' ;
1313
@@ -40,20 +40,7 @@ export function MemoryDetailsSection({memoryStats}: MemoryDetailsSectionProps) {
4040 } , [ memorySegments ] ) ;
4141
4242 const formatValues = React . useCallback ( ( value ?: number , total ?: number ) : [ string , string ] => {
43- return [
44- formatBytes ( {
45- value : value || 0 ,
46- size : 'gb' ,
47- withSizeLabel : false ,
48- precision : 2 ,
49- } ) ,
50- formatBytes ( {
51- value : total || 0 ,
52- size : 'gb' ,
53- withSizeLabel : true ,
54- precision : 1 ,
55- } ) ,
56- ] ;
43+ return formatStorageValuesToGb ( value , total ) as [ string , string ] ;
5744 } , [ ] ) ;
5845
5946 return (
Original file line number Diff line number Diff line change @@ -44,10 +44,7 @@ export function TenantMemory({
4444 < ProgressWrapper
4545 value = { memoryUsed }
4646 capacity = { memoryLimit }
47- formatValues = { ( value , total ) => [
48- formatStorageValuesToGb ( Number ( value ) ) [ 0 ] ,
49- formatStorageValuesToGb ( Number ( total ) ) [ 0 ] ,
50- ] }
47+ formatValues = { formatStorageValuesToGb }
5148 withCapacityUsage
5249 size = "m"
5350 width = "full"
You can’t perform that action at this time.
0 commit comments