@@ -6,10 +6,9 @@ import {EFlag} from '../../types/api/enums';
66import { valueIsDefined } from '../../utils' ;
77import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants' ;
88import { createPDiskDeveloperUILink } from '../../utils/developerUI/developerUI' ;
9- import { getPDiskId } from '../../utils/disks/helpers' ;
109import type { PreparedPDisk } from '../../utils/disks/types' ;
1110import { useTypedSelector } from '../../utils/hooks' ;
12- import { bytesToGB } from '../../utils/utils' ;
11+ import { bytesToGB , isNumeric } from '../../utils/utils' ;
1312import { InfoViewer } from '../InfoViewer' ;
1413import type { InfoViewerItem } from '../InfoViewer' ;
1514import { LinkWithIcon } from '../LinkWithIcon/LinkWithIcon' ;
@@ -21,12 +20,23 @@ export const preparePDiskData = (
2120 nodeHost ?: string ,
2221 withDeveloperUILink ?: boolean ,
2322) => {
24- const { AvailableSize, TotalSize, State, PDiskId, NodeId, Path, Realtime, Type, Device} = data ;
23+ const {
24+ AvailableSize,
25+ TotalSize,
26+ State,
27+ PDiskId,
28+ NodeId,
29+ StringifiedId,
30+ Path,
31+ Realtime,
32+ Type,
33+ Device,
34+ } = data ;
2535
2636 const pdiskData : InfoViewerItem [ ] = [
2737 {
2838 label : 'PDisk' ,
29- value : getPDiskId ( NodeId , PDiskId ) ?? EMPTY_DATA_PLACEHOLDER ,
39+ value : StringifiedId ?? EMPTY_DATA_PLACEHOLDER ,
3040 } ,
3141 { label : 'State' , value : State || 'not available' } ,
3242 { label : 'Type' , value : Type || 'unknown' } ,
@@ -44,10 +54,12 @@ export const preparePDiskData = (
4454 pdiskData . push ( { label : 'Path' , value : Path } ) ;
4555 }
4656
47- pdiskData . push ( {
48- label : 'Available' ,
49- value : `${ bytesToGB ( AvailableSize ) } of ${ bytesToGB ( TotalSize ) } ` ,
50- } ) ;
57+ if ( isNumeric ( TotalSize ) ) {
58+ pdiskData . push ( {
59+ label : 'Available' ,
60+ value : `${ bytesToGB ( AvailableSize ) } of ${ bytesToGB ( TotalSize ) } ` ,
61+ } ) ;
62+ }
5163
5264 if ( Realtime && errorColors . includes ( Realtime ) ) {
5365 pdiskData . push ( { label : 'Realtime' , value : Realtime } ) ;
0 commit comments