@@ -2,17 +2,14 @@ import React from 'react';
22
33import { Flex } from '@gravity-ui/uikit' ;
44
5- import type { InfoViewerItem } from '../../../components/InfoViewer/InfoViewer' ;
6- import { LinkWithIcon } from '../../../components/LinkWithIcon/LinkWithIcon' ;
75import { ProgressViewer } from '../../../components/ProgressViewer/ProgressViewer' ;
86import { Tags } from '../../../components/Tags' ;
97import { useClusterBaseInfo } from '../../../store/reducers/cluster/cluster' ;
108import type { ClusterLink } from '../../../types/additionalProps' ;
119import { isClusterInfoV2 } from '../../../types/api/cluster' ;
1210import type { TClusterInfo } from '../../../types/api/cluster' ;
1311import type { EFlag } from '../../../types/api/enums' ;
14- import type { TTabletStateInfo } from '../../../types/api/tablet' ;
15- import { EType } from '../../../types/api/tablet' ;
12+ import type { InfoItem } from '../../../types/components' ;
1613import { formatNumber } from '../../../utils/dataFormatters/dataFormatters' ;
1714import { parseJson } from '../../../utils/utils' ;
1815import i18n from '../i18n' ;
@@ -29,18 +26,6 @@ const COLORS_PRIORITY: Record<EFlag, number> = {
2926 Grey : 0 ,
3027} ;
3128
32- export const compareTablets = ( tablet1 : TTabletStateInfo , tablet2 : TTabletStateInfo ) => {
33- if ( tablet1 . Type === EType . TxAllocator ) {
34- return 1 ;
35- }
36-
37- if ( tablet2 . Type === EType . TxAllocator ) {
38- return - 1 ;
39- }
40-
41- return 0 ;
42- } ;
43-
4429const getDCInfo = ( cluster : TClusterInfo ) => {
4530 if ( isClusterInfoV2 ( cluster ) && cluster . MapDataCenters ) {
4631 return Object . entries ( cluster . MapDataCenters ) . map ( ( [ dc , count ] ) => (
@@ -52,12 +37,8 @@ const getDCInfo = (cluster: TClusterInfo) => {
5237 return undefined ;
5338} ;
5439
55- export const getInfo = (
56- cluster : TClusterInfo ,
57- additionalInfo : InfoViewerItem [ ] ,
58- links : ClusterLink [ ] ,
59- ) => {
60- const info : InfoViewerItem [ ] = [ ] ;
40+ export const getInfo = ( cluster : TClusterInfo , additionalInfo : InfoItem [ ] ) => {
41+ const info : InfoItem [ ] = [ ] ;
6142
6243 if ( isClusterInfoV2 ( cluster ) && cluster . MapNodeStates ) {
6344 const arrayNodesStates = Object . entries ( cluster . MapNodeStates ) as [ EFlag , number ] [ ] ;
@@ -80,7 +61,7 @@ export const getInfo = (
8061 if ( dataCenters ?. length ) {
8162 info . push ( {
8263 label : i18n ( 'label_dc' ) ,
83- value : < Tags tags = { dataCenters } gap = { 2 } /> ,
64+ value : < Tags tags = { dataCenters } gap = { 2 } className = { b ( 'dc' ) } /> ,
8465 } ) ;
8566 }
8667
@@ -91,19 +72,6 @@ export const getInfo = (
9172
9273 info . push ( ...additionalInfo ) ;
9374
94- if ( links . length ) {
95- info . push ( {
96- label : i18n ( 'links' ) ,
97- value : (
98- < div className = { b ( 'links' ) } >
99- { links . map ( ( { title, url} ) => (
100- < LinkWithIcon key = { title } title = { title } url = { url } />
101- ) ) }
102- </ div >
103- ) ,
104- } ) ;
105- }
106-
10775 return info ;
10876} ;
10977
0 commit comments