File tree Expand file tree Collapse file tree 4 files changed +39
-28
lines changed
components/Tooltips/NodeEndpointsTooltip Expand file tree Collapse file tree 4 files changed +39
-28
lines changed Original file line number Diff line number Diff line change 1+ .ydb-node-endpoints-tooltip {
2+ .info-viewer__value {
3+ min-width : 70px ;
4+ }
5+ }
Original file line number Diff line number Diff line change 1+ import block from 'bem-cn-lite' ;
2+
3+ import type { TSystemStateInfo } from '../../../types/api/nodes' ;
4+
5+ import { InfoViewer , InfoViewerItem } from '../../InfoViewer' ;
6+
7+ import './NodeEndpointsTooltip.scss' ;
8+
9+ const b = block ( 'ydb-node-endpoints-tooltip' ) ;
10+
11+ interface NodeEdpointsTooltipProps {
12+ data ?: TSystemStateInfo ;
13+ }
14+
15+ export const NodeEndpointsTooltip = ( { data} : NodeEdpointsTooltipProps ) => {
16+ const info : InfoViewerItem [ ] = [ ] ;
17+
18+ if ( data ?. Rack ) {
19+ info . push ( { label : 'Rack' , value : data . Rack } ) ;
20+ }
21+
22+ if ( data ?. Endpoints && data . Endpoints . length ) {
23+ data . Endpoints . forEach ( ( { Name, Address} ) => {
24+ if ( Name && Address ) {
25+ info . push ( { label : Name , value : Address } ) ;
26+ }
27+ } ) ;
28+ }
29+
30+ return < InfoViewer className = { b ( null ) } info = { info } dots = { false } size = { 's' } /> ;
31+ } ;
Original file line number Diff line number Diff line change 1+ export * from './NodeEndpointsTooltip' ;
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import cn from 'bem-cn-lite';
22import { calcUptime } from '.' ;
33import JSONTree from 'react-json-inspector' ;
44
5+ import { NodeEndpointsTooltip } from '../components/Tooltips/NodeEndpointsTooltip' ;
6+
57const poolB = cn ( 'pool-tooltip' ) ;
68
79const PoolTooltip = ( props ) => {
@@ -109,34 +111,6 @@ const NodeTooltip = (props) => {
109111 ) ;
110112} ;
111113
112- const NodeEndpointsTooltip = ( props ) => {
113- const { data} = props ;
114- return (
115- data && (
116- < div className = { nodeB ( ) } >
117- < table >
118- < tbody >
119- { data . Rack && (
120- < tr >
121- < td className = { nodeB ( 'label' ) } > Rack</ td >
122- < td className = { nodeB ( 'value' ) } > { data . Rack } </ td >
123- </ tr >
124- ) }
125- { data . Endpoints &&
126- data . Endpoints . length &&
127- data . Endpoints . map ( ( { Name, Address} ) => (
128- < tr key = { Name } >
129- < td className = { nodeB ( 'label' ) } > { Name } </ td >
130- < td className = { nodeB ( 'value' ) } > { Address } </ td >
131- </ tr >
132- ) ) }
133- </ tbody >
134- </ table >
135- </ div >
136- )
137- ) ;
138- } ;
139-
140114const tabletsOverallB = cn ( 'tabletsOverall-tooltip' ) ;
141115
142116const TabletsOverallTooltip = ( props ) => {
You can’t perform that action at this time.
0 commit comments