1+ import { ReactNode } from 'react' ;
12import { connect } from 'react-redux' ;
3+ import cn from 'bem-cn-lite' ;
24
3- import { RadioButton , Switch } from '@gravity-ui/uikit' ;
5+ import { RadioButton , Switch , HelpPopover } from '@gravity-ui/uikit' ;
46import { Settings } from '@gravity-ui/navigation' ;
57
68import favoriteFilledIcon from '../../assets/icons/star.svg' ;
@@ -14,6 +16,10 @@ import {
1416
1517import { setSettingValue } from '../../store/reducers/settings' ;
1618
19+ import './UserSettings.scss' ;
20+
21+ const b = cn ( 'ydb-user-settings' ) ;
22+
1723enum Theme {
1824 light = 'light' ,
1925 dark = 'dark' ,
@@ -33,6 +39,19 @@ function UserSettings(props: any) {
3339 props . setSettingValue ( USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY , String ( value ) ) ;
3440 } ;
3541
42+ const renderBreakNodesSettingsItem = ( title : ReactNode ) => {
43+ return (
44+ < div className = { b ( 'item-with-popup' ) } >
45+ { title }
46+ < HelpPopover
47+ content = "Use /viewer/json/nodes endpoint for Nodes Tab in diagnostics. It returns incorrect data on older versions"
48+ contentClassName = { b ( 'popup' ) }
49+ hasArrow = { true }
50+ />
51+ </ div >
52+ ) ;
53+ } ;
54+
3655 return (
3756 < Settings >
3857 < Settings . Page
@@ -58,7 +77,10 @@ function UserSettings(props: any) {
5877 onUpdate = { _onInvertedDisksChangeHandler }
5978 />
6079 </ Settings . Item >
61- < Settings . Item title = "Use /viewer/json/nodes for Nodes Tab in diagnostics" >
80+ < Settings . Item
81+ title = "Break the Nodes tab in Diagnostics"
82+ renderTitleComponent = { renderBreakNodesSettingsItem }
83+ >
6284 < Switch
6385 checked = { props . useNodesEndpointInDiagnostics }
6486 onUpdate = { _onNodesEndpointChangeHandler }
0 commit comments