1- import cn from 'bem-cn-lite' ;
21import DataTable , { Column } from '@gravity-ui/react-data-table' ;
3- import { Button , Popover , PopoverBehavior } from '@gravity-ui/uikit' ;
2+ import { Popover } from '@gravity-ui/uikit' ;
43
5- import { IconWrapper } from '../../components/Icon' ;
6- import EntityStatus from '../../components/EntityStatus/EntityStatus' ;
74import PoolsGraph from '../../components/PoolsGraph/PoolsGraph' ;
85import ProgressViewer from '../../components/ProgressViewer/ProgressViewer' ;
96import { TabletsStatistic } from '../../components/TabletsStatistic' ;
10- import { NodeEndpointsTooltip } from '../../components/Tooltips/NodeEndpointsTooltip/NodeEndpointsTooltip ' ;
7+ import { NodeHostWrapper } from '../../components/NodeHostWrapper/NodeHostWrapper ' ;
118
9+ import type { NodeAddress } from '../../utils/nodes' ;
1210import { formatBytesToGigabyte } from '../../utils/index' ;
13- import { INodesPreparedEntity } from '../../types/store/nodes' ;
14- import { showTooltip as externalShowTooltip } from '../../store/reducers/tooltip' ;
15-
16- import { getDefaultNodePath } from '../Node/NodePages' ;
17-
18- import './NodesTable.scss' ;
1911
20- const b = cn ( 'ydb-nodes-table' ) ;
12+ import type { INodesPreparedEntity } from '../../types/store/nodes' ;
13+ import { showTooltip as externalShowTooltip } from '../../store/reducers/tooltip' ;
2114
2215interface GetNodesColumnsProps {
2316 showTooltip : ( ...args : Parameters < typeof externalShowTooltip > ) => void ;
2417 hideTooltip : VoidFunction ;
2518 tabletsPath ?: string ;
26- getNodeRef ?: Function ;
19+ getNodeRef ?: ( node ?: NodeAddress ) => string ;
2720}
2821
2922export function getNodesColumns ( {
@@ -42,39 +35,7 @@ export function getNodesColumns({
4235 {
4336 name : 'Host' ,
4437 render : ( { row} ) => {
45- const nodeRef = getNodeRef ? getNodeRef ( row ) + 'internal' : undefined ;
46- if ( typeof row . Host === 'undefined' ) {
47- return < span > —</ span > ;
48- }
49- return (
50- < div className = { b ( 'host-field-wrapper' ) } >
51- < Popover
52- content = { < NodeEndpointsTooltip data = { row } /> }
53- placement = { [ 'top' , 'bottom' ] }
54- behavior = { PopoverBehavior . Immediate }
55- >
56- < div className = { b ( 'host-wrapper' ) } >
57- < EntityStatus
58- name = { row . Host }
59- status = { row . SystemState }
60- path = { getDefaultNodePath ( row . NodeId ) }
61- hasClipboardButton
62- className = { b ( 'host' ) }
63- />
64- { nodeRef && (
65- < Button
66- size = "s"
67- href = { nodeRef }
68- className = { b ( 'external-button' ) }
69- target = "_blank"
70- >
71- < IconWrapper name = "external" />
72- </ Button >
73- ) }
74- </ div >
75- </ Popover >
76- </ div >
77- ) ;
38+ return < NodeHostWrapper node = { row } getNodeRef = { getNodeRef } /> ;
7839 } ,
7940 width : '350px' ,
8041 align : DataTable . LEFT ,
0 commit comments