@@ -2,6 +2,7 @@ import React, {useEffect, useState, useRef, useMemo} from 'react';
22import cn from 'bem-cn-lite' ;
33
44import { InternalLink } from '../../../components/InternalLink' ;
5+ import { Stack } from '../../../components/Stack/Stack' ;
56
67import routes , { createHref } from '../../../routes' ;
78import { getVDisksForPDisk } from '../../../store/reducers/storage' ;
@@ -10,6 +11,7 @@ import {TVDiskStateInfo} from '../../../types/api/vdisk';
1011import { stringifyVdiskId } from '../../../utils' ;
1112import { useTypedSelector } from '../../../utils/hooks' ;
1213import { getPDiskType } from '../../../utils/pdisk' ;
14+ import { isFullVDiksData } from '../../../utils/storage' ;
1315
1416import { STRUCTURE } from '../../Node/NodePages' ;
1517
@@ -109,19 +111,42 @@ export const PDisk = ({nodeId, data: rawData = {}}: PDiskProps) => {
109111
110112 return (
111113 < div className = { b ( 'vdisks' ) } >
112- { vdisks . map ( ( vdisk ) => (
113- < div
114- key = { stringifyVdiskId ( vdisk . VDiskId ) }
115- className = { b ( 'vdisks-item' ) }
116- style = { {
117- // 1 is small enough for empty disks to be of the minimum width
118- // but if all of them are empty, `flex-grow: 1` would size them evenly
119- flexGrow : Number ( vdisk . AllocatedSize ) || 1 ,
120- } }
121- >
122- < VDisk data = { vdisk } compact />
123- </ div >
124- ) ) }
114+ { vdisks . map ( ( vdisk ) => {
115+ const donors = vdisk . Donors ;
116+
117+ return (
118+ < div
119+ key = { stringifyVdiskId ( vdisk . VDiskId ) }
120+ className = { b ( 'vdisks-item' ) }
121+ style = { {
122+ // 1 is small enough for empty disks to be of the minimum width
123+ // but if all of them are empty, `flex-grow: 1` would size them evenly
124+ flexGrow : Number ( vdisk . AllocatedSize ) || 1 ,
125+ } }
126+ >
127+ { donors && donors . length ? (
128+ < Stack className = { b ( 'donors-stack' ) } key = { stringifyVdiskId ( vdisk . VDiskId ) } >
129+ < VDisk data = { vdisk } compact />
130+ { donors . map ( ( donor ) => {
131+ const isFullData = isFullVDiksData ( donor ) ;
132+
133+ return (
134+ < VDisk
135+ compact
136+ data = { isFullData ? donor : { ...donor , DonorMode : true } }
137+ key = { stringifyVdiskId (
138+ isFullData ? donor . VDiskId : donor ,
139+ ) }
140+ />
141+ ) ;
142+ } ) }
143+ </ Stack >
144+ ) : (
145+ < VDisk data = { vdisk } compact />
146+ ) }
147+ </ div >
148+ ) ;
149+ } ) }
125150 </ div >
126151 ) ;
127152 } ;
0 commit comments