@@ -2,10 +2,20 @@ import _ from 'lodash';
22import cn from 'bem-cn-lite' ;
33
44import DataTable , { Column , Settings , SortOrder } from '@gravity-ui/react-data-table' ;
5- import { Popover , PopoverBehavior } from '@gravity-ui/uikit' ;
5+ import { Button , Popover , PopoverBehavior } from '@gravity-ui/uikit' ;
6+
7+ import { NodeEndpointsTooltip } from '../../../components/Tooltips/NodeEndpointsTooltip/NodeEndpointsTooltip' ;
8+ import EntityStatus from '../../../components/EntityStatus/EntityStatus' ;
9+ import { IconWrapper } from '../../../components/Icon' ;
610
711import { VisibleEntities } from '../../../store/reducers/storage' ;
8- import { isUnavailableNode , NodesUptimeFilterValues } from '../../../utils/nodes' ;
12+ import {
13+ AdditionalNodesInfo ,
14+ isUnavailableNode ,
15+ NodesUptimeFilterValues ,
16+ } from '../../../utils/nodes' ;
17+
18+ import { getDefaultNodePath } from '../../Node/NodePages' ;
919
1020import { EmptyFilter } from '../EmptyFilter/EmptyFilter' ;
1121import { PDisk } from '../PDisk' ;
@@ -33,6 +43,7 @@ interface StorageNodesProps {
3343 visibleEntities : keyof typeof VisibleEntities ;
3444 nodesUptimeFilter : keyof typeof NodesUptimeFilterValues ;
3545 onShowAll ?: VoidFunction ;
46+ additionalNodesInfo ?: AdditionalNodesInfo ;
3647}
3748
3849const tableColumnsNames : Record < TableColumnsIdsValues , string > = {
@@ -73,7 +84,10 @@ function StorageNodes({
7384 visibleEntities,
7485 onShowAll,
7586 nodesUptimeFilter,
87+ additionalNodesInfo,
7688} : StorageNodesProps ) {
89+ const getNodeRef = additionalNodesInfo ?. getNodeRef ;
90+
7791 const allColumns : Column < any > [ ] = [
7892 {
7993 name : TableColumnsIds . NodeId ,
@@ -85,15 +99,37 @@ function StorageNodes({
8599 name : TableColumnsIds . FQDN ,
86100 header : tableColumnsNames [ TableColumnsIds . FQDN ] ,
87101 width : 350 ,
88- render : ( { value} ) => {
102+ render : ( { row} ) => {
103+ const nodeRef = getNodeRef ? getNodeRef ( row ) + 'internal' : undefined ;
104+ if ( ! row . Host ) {
105+ return < span > —</ span > ;
106+ }
89107 return (
90- < div className = { b ( 'fqdn-wrapper' ) } >
108+ < div className = { b ( 'fqdn-field- wrapper' ) } >
91109 < Popover
92- content = { value as string }
93- placement = { [ 'right ' ] }
110+ content = { < NodeEndpointsTooltip data = { row } /> }
111+ placement = { [ 'top' , 'bottom '] }
94112 behavior = { PopoverBehavior . Immediate }
95113 >
96- < span className = { b ( 'fqdn' ) } > { value as string } </ span >
114+ < div className = { b ( 'fqdn-wrapper' ) } >
115+ < EntityStatus
116+ name = { row . Host }
117+ showStatus = { false }
118+ path = { getDefaultNodePath ( row . NodeId ) }
119+ hasClipboardButton
120+ className = { b ( 'fqdn' ) }
121+ />
122+ { nodeRef && (
123+ < Button
124+ size = "s"
125+ href = { nodeRef }
126+ className = { b ( 'external-button' ) }
127+ target = "_blank"
128+ >
129+ < IconWrapper name = "external" />
130+ </ Button >
131+ ) }
132+ </ div >
97133 </ Popover >
98134 </ div >
99135 ) ;
0 commit comments