@@ -134,7 +134,7 @@ function VDiskInfo({location}: StorageSectionProps) {
134
134
) ;
135
135
}
136
136
function PDiskInfo ( { location} : StorageSectionProps ) {
137
- const { node , pool} = location ?? { } ;
137
+ const { pool} = location ?? { } ;
138
138
const { group} = pool ?? { } ;
139
139
const { vdisk} = group ?? { } ;
140
140
const { pdisk} = vdisk ?? { } ;
@@ -143,23 +143,33 @@ function PDiskInfo({location}: StorageSectionProps) {
143
143
return null ;
144
144
}
145
145
146
- return pdisk . map ( ( disk ) => (
147
- < LocationDetails
148
- key = { disk . id || disk . path }
149
- fields = { [
150
- {
151
- value :
152
- disk . id && node ?. id ? (
153
- < InternalLink to = { getPDiskPagePath ( disk . id , node . id ) } >
154
- { disk . id }
155
- </ InternalLink >
156
- ) : (
157
- disk . id
158
- ) ,
159
- title : i18n ( 'label_pdisk-id' ) ,
160
- } ,
161
- { value : disk . path , title : i18n ( 'label_pdisk-path' ) } ,
162
- ] }
163
- />
164
- ) ) ;
146
+ return pdisk . map ( ( disk ) => {
147
+ let nodeId : string | undefined ;
148
+ let pdiskId : string | undefined ;
149
+ if ( disk . id ) {
150
+ const splittedId = disk . id . split ( '-' ) ;
151
+ nodeId = splittedId [ 0 ] ;
152
+ pdiskId = splittedId . slice ( 1 ) . join ( '-' ) ;
153
+ }
154
+
155
+ return (
156
+ < LocationDetails
157
+ key = { disk . id || disk . path }
158
+ fields = { [
159
+ {
160
+ value :
161
+ nodeId && pdiskId ? (
162
+ < InternalLink to = { getPDiskPagePath ( pdiskId , nodeId ) } >
163
+ { disk . id }
164
+ </ InternalLink >
165
+ ) : (
166
+ disk . id
167
+ ) ,
168
+ title : i18n ( 'label_pdisk-id' ) ,
169
+ } ,
170
+ { value : disk . path , title : i18n ( 'label_pdisk-path' ) } ,
171
+ ] }
172
+ />
173
+ ) ;
174
+ } ) ;
165
175
}
0 commit comments