@@ -10,7 +10,7 @@ import {TPDiskState} from '../../../types/api/pdisk';
1010import { EFlag } from '../../../types/api/enums' ;
1111import { getPDiskType } from '../../../utils/pdisk' ;
1212import { getUsage } from '../../../utils/storage' ;
13- import { calcUptime } from '../../../utils/dataFormatters/dataFormatters ' ;
13+ import { prepareNodeSystemState } from '../../../utils/nodes ' ;
1414
1515import type { PreparedStorageGroup , PreparedStorageNode , PreparedStorageResponse } from './types' ;
1616
@@ -168,21 +168,14 @@ export const prepareStorageGroups = (
168168// ==== Prepare nodes ====
169169
170170const prepareStorageNodeData = ( node : TNodeInfo ) : PreparedStorageNode => {
171- const systemState = node . SystemState ?? { } ;
172171 const missing =
173172 node . PDisks ?. filter ( ( pDisk ) => {
174173 return pDisk . State !== TPDiskState . Normal ;
175174 } ) . length || 0 ;
176175
177176 return {
177+ ...prepareNodeSystemState ( node . SystemState ) ,
178178 NodeId : node . NodeId ,
179- SystemState : systemState . SystemState ,
180- DC : systemState . Location ?. DataCenter ,
181- Rack : systemState . Location ?. Rack ,
182- Host : systemState . Host ,
183- Endpoints : systemState . Endpoints ,
184- Uptime : calcUptime ( systemState . StartTime ) ,
185- StartTime : systemState . StartTime ,
186179 PDisks : node . PDisks ,
187180 VDisks : node . VDisks ,
188181 Missing : missing ,
0 commit comments