Skip to content

Commit 0b151dd

Browse files
committed
Render bar only
1 parent ba797d3 commit 0b151dd

File tree

3 files changed

+36
-43
lines changed

3 files changed

+36
-43
lines changed

src/components/MemoryViewer/MemoryViewer.tsx

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,39 @@ export function MemoryViewer({
9999

100100
return (
101101
<HoverPopup
102-
popupContent={<MemoryViewerComponents stats={stats} formatValues={formatValues} />}
102+
popupContent={
103+
<DefinitionList responsive>
104+
{memorySegments.map(
105+
({label, value: segmentSize, capacity: segmentCapacity, key}) => (
106+
<DefinitionList.Item
107+
key={label}
108+
name={
109+
<div className={b('container')}>
110+
<div className={b('legend', {type: key})}></div>
111+
<div className={b('name')}>{label}</div>
112+
</div>
113+
}
114+
>
115+
{segmentCapacity ? (
116+
<ProgressViewer
117+
value={segmentSize}
118+
capacity={segmentCapacity}
119+
formatValues={formatDetailedValues}
120+
colorizeProgress
121+
/>
122+
) : (
123+
formatBytes({
124+
value: segmentSize,
125+
size: 'gb',
126+
withSizeLabel: true,
127+
precision: 2,
128+
})
129+
)}
130+
</DefinitionList.Item>
131+
),
132+
)}
133+
</DefinitionList>
134+
}
103135
>
104136
<div className={b({theme, status}, className)}>
105137
<div className={b('progress-container')}>
@@ -134,39 +166,3 @@ export function MemoryViewer({
134166
</HoverPopup>
135167
);
136168
}
137-
138-
export function MemoryViewerComponents({stats}: MemoryProgressViewerProps) {
139-
const memorySegments = getMemorySegments(stats);
140-
141-
return (
142-
<DefinitionList responsive>
143-
{memorySegments.map(({label, value: segmentSize, capacity: segmentCapacity, key}) => (
144-
<DefinitionList.Item
145-
key={label}
146-
name={
147-
<div className={b('container')}>
148-
<div className={b('legend', {type: key})}></div>
149-
<div className={b('name')}>{label}</div>
150-
</div>
151-
}
152-
>
153-
{segmentCapacity ? (
154-
<ProgressViewer
155-
value={segmentSize}
156-
capacity={segmentCapacity}
157-
formatValues={formatDetailedValues}
158-
colorizeProgress
159-
/>
160-
) : (
161-
formatBytes({
162-
value: segmentSize,
163-
size: 'gb',
164-
withSizeLabel: true,
165-
precision: 2,
166-
})
167-
)}
168-
</DefinitionList.Item>
169-
))}
170-
</DefinitionList>
171-
);
172-
}

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TenantMemory.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import {MemoryViewerComponents} from '../../../../../components/MemoryViewer/MemoryViewer';
3+
import {MemoryViewer} from '../../../../../components/MemoryViewer/MemoryViewer';
44
import {ProgressViewer} from '../../../../../components/ProgressViewer/ProgressViewer';
55
import type {TMemoryStats} from '../../../../../types/api/nodes';
66
import {formatStorageValuesToGb} from '../../../../../utils/dataFormatters/dataFormatters';
@@ -29,10 +29,7 @@ export function TenantMemory({
2929
<div className={b('title')}>{'Memory details'}</div>
3030
<div className={b('memory-info')}>
3131
{memoryStats ? (
32-
<MemoryViewerComponents
33-
formatValues={formatStorageValuesToGb}
34-
stats={memoryStats}
35-
/>
32+
<MemoryViewer formatValues={formatStorageValuesToGb} stats={memoryStats} />
3633
) : (
3734
<ProgressViewer
3835
value={memoryUsed}

src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
}
6666

6767
&__memory-info {
68-
width: 400px;
68+
width: 300px;
6969
margin-bottom: 36px;
7070
}
7171
}

0 commit comments

Comments
 (0)