@@ -6,7 +6,6 @@ import {EFlag} from '../../types/api/enums';
6
6
import { valueIsDefined } from '../../utils' ;
7
7
import { EMPTY_DATA_PLACEHOLDER } from '../../utils/constants' ;
8
8
import { createPDiskDeveloperUILink } from '../../utils/developerUI/developerUI' ;
9
- import { getPDiskId } from '../../utils/disks/helpers' ;
10
9
import type { PreparedPDisk } from '../../utils/disks/types' ;
11
10
import { useTypedSelector } from '../../utils/hooks' ;
12
11
import { bytesToGB } from '../../utils/utils' ;
@@ -21,12 +20,23 @@ export const preparePDiskData = (
21
20
nodeHost ?: string ,
22
21
withDeveloperUILink ?: boolean ,
23
22
) => {
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 ;
25
35
26
36
const pdiskData : InfoViewerItem [ ] = [
27
37
{
28
38
label : 'PDisk' ,
29
- value : getPDiskId ( NodeId , PDiskId ) ?? EMPTY_DATA_PLACEHOLDER ,
39
+ value : StringifiedId ?? EMPTY_DATA_PLACEHOLDER ,
30
40
} ,
31
41
{ label : 'State' , value : State || 'not available' } ,
32
42
{ label : 'Type' , value : Type || 'unknown' } ,
@@ -44,10 +54,12 @@ export const preparePDiskData = (
44
54
pdiskData . push ( { label : 'Path' , value : Path } ) ;
45
55
}
46
56
47
- pdiskData . push ( {
48
- label : 'Available' ,
49
- value : `${ bytesToGB ( AvailableSize ) } of ${ bytesToGB ( TotalSize ) } ` ,
50
- } ) ;
57
+ if ( ! isNaN ( Number ( TotalSize ) ) ) {
58
+ pdiskData . push ( {
59
+ label : 'Available' ,
60
+ value : `${ bytesToGB ( AvailableSize ) } of ${ bytesToGB ( TotalSize ) } ` ,
61
+ } ) ;
62
+ }
51
63
52
64
if ( Realtime && errorColors . includes ( Realtime ) ) {
53
65
pdiskData . push ( { label : 'Realtime' , value : Realtime } ) ;
0 commit comments