Skip to content

Commit 8c89486

Browse files
Add replication progress and time remaining to VDisk tooltip
Co-authored-by: antonkovalenko <[email protected]>
1 parent 02709c3 commit 8c89486

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/components/VDiskPopup/VDiskPopup.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {EFlag} from '../../types/api/enums';
77
import {valueIsDefined} from '../../utils';
88
import {cn} from '../../utils/cn';
99
import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
10+
import {formatUptimeInSeconds} from '../../utils/dataFormatters/dataFormatters';
1011
import {createVDiskDeveloperUILink} from '../../utils/developerUI/developerUI';
1112
import {isFullVDiskData} from '../../utils/disks/helpers';
1213
import type {PreparedVDisk, UnavailableDonor} from '../../utils/disks/types';
@@ -73,6 +74,8 @@ const prepareVDiskData = (data: PreparedVDisk, withDeveloperUILink?: boolean) =>
7374
DiskSpace,
7475
FrontQueues,
7576
Replicated,
77+
ReplicationProgress,
78+
ReplicationSecondsRemaining,
7679
UnsyncedVDisks,
7780
AllocatedSize,
7881
ReadThroughput,
@@ -129,6 +132,24 @@ const prepareVDiskData = (data: PreparedVDisk, withDeveloperUILink?: boolean) =>
129132
vdiskData.push({label: 'Replicated', value: 'NO'});
130133
}
131134

135+
if (valueIsDefined(ReplicationProgress)) {
136+
const progressPercent = Math.round(ReplicationProgress * 100);
137+
vdiskData.push({
138+
label: 'Replication Progress',
139+
value: `${progressPercent}%`,
140+
});
141+
}
142+
143+
if (valueIsDefined(ReplicationSecondsRemaining)) {
144+
const timeRemaining = formatUptimeInSeconds(ReplicationSecondsRemaining);
145+
if (timeRemaining) {
146+
vdiskData.push({
147+
label: 'Time Remaining',
148+
value: timeRemaining,
149+
});
150+
}
151+
}
152+
132153
if (UnsyncedVDisks) {
133154
vdiskData.push({label: 'UnsyncVDisks', value: UnsyncedVDisks});
134155
}

0 commit comments

Comments
 (0)