@@ -4,8 +4,11 @@ import DataTable, {Column, Settings, SortOrder} from '@yandex-cloud/react-data-t
44import { Popover , PopoverBehavior } from '@yandex-cloud/uikit' ;
55
66import Vdisk from '../Vdisk/Vdisk' ;
7+ import { Stack } from '../../../components/Stack/Stack' ;
78//@ts -ignore
89import EntityStatus from '../../../components/EntityStatus/EntityStatus' ;
10+
11+ import { TVDiskStateInfo } from '../../../types/api/storage' ;
912//@ts -ignore
1013import { VisibleEntities } from '../../../store/reducers/storage' ;
1114//@ts -ignore
@@ -190,17 +193,37 @@ function StorageGroups({data, tableSettings, visibleEntities, nodes}: StorageGro
190193 } ,
191194 {
192195 name : TableColumnsIds . VDisks ,
196+ className : b ( 'vdisks-column' ) ,
193197 header : tableColumnsNames [ TableColumnsIds . VDisks ] ,
194198 render : ( { value, row} ) => (
195199 < div className = { b ( 'vdisks-wrapper' ) } >
196- { _ . map ( value as any , ( el ) => (
197- < div className = { b ( 'vdisks-item' ) } key = { stringifyVdiskId ( el . VDiskId ) } >
198- < Vdisk
199- { ...el }
200- PoolName = { row [ TableColumnsIds . PoolName ] }
201- nodes = { nodes }
202- />
203- </ div >
200+ { _ . map ( value as TVDiskStateInfo [ ] , ( el ) => (
201+ Array . isArray ( el . Donors ) && el . Donors . length > 0 ? (
202+ < Stack className = { b ( 'vdisks-item' ) } key = { stringifyVdiskId ( el . VDiskId ) } >
203+ < Vdisk
204+ { ...el }
205+ PoolName = { row [ TableColumnsIds . PoolName ] }
206+ nodes = { nodes }
207+ />
208+ { el . Donors . map ( ( donor ) => (
209+ < Vdisk
210+ { ...donor }
211+ // donor and acceptor are always in the same group
212+ PoolName = { row [ TableColumnsIds . PoolName ] }
213+ nodes = { nodes }
214+ key = { stringifyVdiskId ( donor . VDiskId ) }
215+ />
216+ ) ) }
217+ </ Stack >
218+ ) : (
219+ < div className = { b ( 'vdisks-item' ) } key = { stringifyVdiskId ( el . VDiskId ) } >
220+ < Vdisk
221+ { ...el }
222+ PoolName = { row [ TableColumnsIds . PoolName ] }
223+ nodes = { nodes }
224+ />
225+ </ div >
226+ )
204227 ) ) }
205228 </ div >
206229 ) ,
0 commit comments