@@ -2,17 +2,14 @@ import React from 'react';
2
2
3
3
import { Flex } from '@gravity-ui/uikit' ;
4
4
5
- import type { InfoViewerItem } from '../../../components/InfoViewer/InfoViewer' ;
6
- import { LinkWithIcon } from '../../../components/LinkWithIcon/LinkWithIcon' ;
7
5
import { ProgressViewer } from '../../../components/ProgressViewer/ProgressViewer' ;
8
6
import { Tags } from '../../../components/Tags' ;
9
7
import { useClusterBaseInfo } from '../../../store/reducers/cluster/cluster' ;
10
8
import type { ClusterLink } from '../../../types/additionalProps' ;
11
9
import { isClusterInfoV2 } from '../../../types/api/cluster' ;
12
10
import type { TClusterInfo } from '../../../types/api/cluster' ;
13
11
import 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' ;
16
13
import { formatNumber } from '../../../utils/dataFormatters/dataFormatters' ;
17
14
import { parseJson } from '../../../utils/utils' ;
18
15
import i18n from '../i18n' ;
@@ -29,18 +26,6 @@ const COLORS_PRIORITY: Record<EFlag, number> = {
29
26
Grey : 0 ,
30
27
} ;
31
28
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
-
44
29
const getDCInfo = ( cluster : TClusterInfo ) => {
45
30
if ( isClusterInfoV2 ( cluster ) && cluster . MapDataCenters ) {
46
31
return Object . entries ( cluster . MapDataCenters ) . map ( ( [ dc , count ] ) => (
@@ -52,12 +37,8 @@ const getDCInfo = (cluster: TClusterInfo) => {
52
37
return undefined ;
53
38
} ;
54
39
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 [ ] = [ ] ;
61
42
62
43
if ( isClusterInfoV2 ( cluster ) && cluster . MapNodeStates ) {
63
44
const arrayNodesStates = Object . entries ( cluster . MapNodeStates ) as [ EFlag , number ] [ ] ;
@@ -80,7 +61,7 @@ export const getInfo = (
80
61
if ( dataCenters ?. length ) {
81
62
info . push ( {
82
63
label : i18n ( 'label_dc' ) ,
83
- value : < Tags tags = { dataCenters } gap = { 2 } /> ,
64
+ value : < Tags tags = { dataCenters } gap = { 2 } className = { b ( 'dc' ) } /> ,
84
65
} ) ;
85
66
}
86
67
@@ -91,19 +72,6 @@ export const getInfo = (
91
72
92
73
info . push ( ...additionalInfo ) ;
93
74
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
-
107
75
return info ;
108
76
} ;
109
77
0 commit comments