@@ -6,18 +6,21 @@ import {
6
6
TriangleExclamationFill ,
7
7
} from '@gravity-ui/icons' ;
8
8
import type { IconData } from '@gravity-ui/uikit' ;
9
- import { Icon } from '@gravity-ui/uikit' ;
9
+ import { Icon , Popover } from '@gravity-ui/uikit' ;
10
10
11
11
import { DiagnosticCard } from '../../../../../components/DiagnosticCard/DiagnosticCard' ;
12
12
import { ResponseError } from '../../../../../components/Errors/ResponseError' ;
13
13
import { Loader } from '../../../../../components/Loader' ;
14
+ import { useClusterBaseInfo } from '../../../../../store/reducers/cluster/cluster' ;
14
15
import { healthcheckApi } from '../../../../../store/reducers/healthcheckInfo/healthcheckInfo' ;
15
16
import { SelfCheckResult } from '../../../../../types/api/healthcheck' ;
16
17
import { cn } from '../../../../../utils/cn' ;
17
18
import { useAutoRefreshInterval } from '../../../../../utils/hooks' ;
18
19
19
20
import i18n from './i18n' ;
20
21
22
+ import CircleExclamationIcon from '@gravity-ui/icons/svgs/circle-exclamation.svg' ;
23
+
21
24
import './Healthcheck.scss' ;
22
25
23
26
const b = cn ( 'healthcheck' ) ;
@@ -38,14 +41,21 @@ const icons: Record<SelfCheckResult, IconData> = {
38
41
export function HealthcheckPreview ( props : HealthcheckPreviewProps ) {
39
42
const { tenantName, active} = props ;
40
43
const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
44
+
45
+ const { name} = useClusterBaseInfo ( ) ;
46
+ const healthcheckPreviewAutorefreshDisabled = name === 'ydb_ru' ;
47
+
41
48
const {
42
49
currentData : data ,
43
50
isFetching,
44
51
error,
45
52
} = healthcheckApi . useGetHealthcheckInfoQuery (
46
53
{ database : tenantName } ,
47
54
{
48
- pollingInterval : autoRefreshInterval ,
55
+ //FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889
56
+ pollingInterval : healthcheckPreviewAutorefreshDisabled
57
+ ? undefined
58
+ : autoRefreshInterval ,
49
59
} ,
50
60
) ;
51
61
@@ -56,6 +66,22 @@ export function HealthcheckPreview(props: HealthcheckPreviewProps) {
56
66
< div className = { b ( 'preview-header' ) } >
57
67
< div className = { b ( 'preview-title-wrapper' ) } >
58
68
< div className = { b ( 'preview-title' ) } > { i18n ( 'title.healthcheck' ) } </ div >
69
+ { /* FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889 */ }
70
+ { autoRefreshInterval && healthcheckPreviewAutorefreshDisabled ? (
71
+ < Popover
72
+ content = { 'Autorefresh is disabled. Please update healthcheck manually.' }
73
+ placement = { [ 'top' ] }
74
+ className = { b ( 'icon-wrapper' ) }
75
+ >
76
+ { ( ) => (
77
+ < Icon
78
+ size = { 16 }
79
+ className = { b ( 'icon-warn' ) }
80
+ data = { CircleExclamationIcon }
81
+ />
82
+ ) }
83
+ </ Popover >
84
+ ) : null }
59
85
</ div >
60
86
</ div >
61
87
) ;
0 commit comments