@@ -5,9 +5,13 @@ import {Flex} from '@gravity-ui/uikit';
55import { getVDiskPagePath } from '../../routes' ;
66import { valueIsDefined } from '../../utils' ;
77import { cn } from '../../utils/cn' ;
8- import { formatStorageValuesToGb } from '../../utils/dataFormatters/dataFormatters' ;
8+ import {
9+ formatStorageValuesToGb ,
10+ formatUptimeInSeconds ,
11+ stringifyVdiskId ,
12+ } from '../../utils/dataFormatters/dataFormatters' ;
913import { createVDiskDeveloperUILink } from '../../utils/developerUI/developerUI' ;
10- import { getSeverityColor } from '../../utils/disks/helpers' ;
14+ import { getSeverityColor , isFullVDiskData } from '../../utils/disks/helpers' ;
1115import type { PreparedVDisk } from '../../utils/disks/types' ;
1216import { useIsUserAllowedToMakeChanges } from '../../utils/hooks/useIsUserAllowedToMakeChanges' ;
1317import { bytesToSpeed } from '../../utils/utils' ;
@@ -46,6 +50,9 @@ export function VDiskInfo<T extends PreparedVDisk>({
4650 FrontQueues,
4751 Guid,
4852 Replicated,
53+ ReplicationProgress,
54+ ReplicationSecondsRemaining,
55+ Donors,
4956 VDiskState,
5057 VDiskSlotId,
5158 Kind,
@@ -130,6 +137,31 @@ export function VDiskInfo<T extends PreparedVDisk>({
130137 value : Replicated ? vDiskInfoKeyset ( 'yes' ) : vDiskInfoKeyset ( 'no' ) ,
131138 } ) ;
132139 }
140+ if ( valueIsDefined ( ReplicationProgress ) ) {
141+ rightColumn . push ( {
142+ label : vDiskInfoKeyset ( 'replication-progress' ) ,
143+ value : (
144+ < ProgressViewer
145+ value = { ReplicationProgress }
146+ capacity = { 1 }
147+ formatValues = { ( value , capacity ) => [
148+ `${ Math . round ( ( value || 0 ) * 100 ) } %` ,
149+ `${ Math . round ( ( capacity || 1 ) * 100 ) } %` ,
150+ ] }
151+ colorizeProgress = { true }
152+ />
153+ ) ,
154+ } ) ;
155+ }
156+ if ( valueIsDefined ( ReplicationSecondsRemaining ) ) {
157+ const timeRemaining = formatUptimeInSeconds ( ReplicationSecondsRemaining ) ;
158+ if ( timeRemaining ) {
159+ rightColumn . push ( {
160+ label : vDiskInfoKeyset ( 'replication-time-remaining' ) ,
161+ value : timeRemaining ,
162+ } ) ;
163+ }
164+ }
133165 if ( valueIsDefined ( VDiskSlotId ) ) {
134166 rightColumn . push ( { label : vDiskInfoKeyset ( 'slot-id' ) , value : VDiskSlotId } ) ;
135167 }
@@ -152,6 +184,22 @@ export function VDiskInfo<T extends PreparedVDisk>({
152184 value : HasUnreadableBlobs ? vDiskInfoKeyset ( 'yes' ) : vDiskInfoKeyset ( 'no' ) ,
153185 } ) ;
154186 }
187+ if ( Donors && Donors . length > 0 ) {
188+ const donorsList = Donors . map ( ( donor ) => {
189+ const isFullData = isFullVDiskData ( donor ) ;
190+ const donorId = stringifyVdiskId ( isFullData ? donor . VDiskId : donor ) ;
191+ return donorId ;
192+ } )
193+ . filter ( Boolean )
194+ . join ( ', ' ) ;
195+
196+ if ( donorsList ) {
197+ rightColumn . push ( {
198+ label : vDiskInfoKeyset ( 'donors' ) ,
199+ value : donorsList ,
200+ } ) ;
201+ }
202+ }
155203
156204 const diskParamsDefined =
157205 valueIsDefined ( PDiskId ) && valueIsDefined ( NodeId ) && valueIsDefined ( VDiskSlotId ) ;
0 commit comments