Skip to content

Commit 9952f18

Browse files
fix: display usage on disks pages (#2999)
1 parent 4c519c1 commit 9952f18

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

src/components/PDiskInfo/PDiskInfo.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function getPDiskInfo<T extends PreparedPDisk>({
4141
SerialNumber,
4242
TotalSize,
4343
AllocatedSize,
44+
AllocatedPercent,
4445
StatusV2,
4546
NumActiveSlots,
4647
ExpectedSlotCount,
@@ -109,6 +110,12 @@ function getPDiskInfo<T extends PreparedPDisk>({
109110
/>
110111
),
111112
});
113+
if (!isNaN(Number(AllocatedPercent))) {
114+
spaceInfo.push({
115+
label: pDiskInfoKeyset('usage'),
116+
value: `${AllocatedPercent}%`,
117+
});
118+
}
112119
if (valueIsDefined(NumActiveSlots) && valueIsDefined(ExpectedSlotCount)) {
113120
spaceInfo.push({
114121
label: pDiskInfoKeyset('slots'),

src/components/PDiskInfo/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"realtime": "Realtime",
1212

1313
"space": "Space",
14+
"usage": "Usage",
1415
"slots": "Slots",
1516
"log-size": "Log Size",
1617
"system-size": "System Size",

src/components/VDiskInfo/VDiskInfo.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export function VDiskInfo<T extends PreparedVDisk>({
5050
const {
5151
AllocatedSize,
5252
SizeLimit,
53+
AllocatedPercent,
5354
DiskSpace,
5455
FrontQueues,
5556
Guid,
@@ -97,6 +98,13 @@ export function VDiskInfo<T extends PreparedVDisk>({
9798
),
9899
});
99100
}
101+
if (!isNaN(Number(AllocatedPercent))) {
102+
leftColumn.push({
103+
label: vDiskInfoKeyset('usage'),
104+
value: `${AllocatedPercent}%`,
105+
});
106+
}
107+
100108
if (!isNil(DiskSpace)) {
101109
leftColumn.push({
102110
label: vDiskInfoKeyset('space-status'),

src/components/VDiskInfo/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"has-unreadable-blobs": "Has Unreadable Blobs",
2323

2424
"size": "Size",
25+
"usage": "Usage",
2526

2627
"read-throughput": "Read Throughput",
2728
"write-throughput": "Write Throughput",

0 commit comments

Comments
 (0)