Skip to content

Commit a0ba20f

Browse files
authored
fix: disable autorefresh for ydb_ru (#1890)
1 parent 85f19c3 commit a0ba20f

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/Healthcheck.scss

+6
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,10 @@
9797

9898
border-radius: 4px;
9999
}
100+
&__icon-warn {
101+
color: var(--g-color-text-warning);
102+
}
103+
&__icon-wrapper {
104+
display: flex;
105+
}
100106
}

src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckDetails.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22

33
import {ResponseError} from '../../../../../components/Errors/ResponseError';
44
import {Loader} from '../../../../../components/Loader';
5+
import {useClusterBaseInfo} from '../../../../../store/reducers/cluster/cluster';
56
import {cn} from '../../../../../utils/cn';
67
import {useAutoRefreshInterval} from '../../../../../utils/hooks';
78
import {useHealthcheck} from '../useHealthcheck';
@@ -19,8 +20,10 @@ interface HealthcheckDetailsProps {
1920

2021
export function HealthcheckDetails({tenantName}: HealthcheckDetailsProps) {
2122
const [autoRefreshInterval] = useAutoRefreshInterval();
23+
const {name} = useClusterBaseInfo();
2224
const {issueTrees, loading, error} = useHealthcheck(tenantName, {
23-
autorefresh: autoRefreshInterval,
25+
//FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889
26+
autorefresh: name === 'ydb_ru' ? undefined : autoRefreshInterval,
2427
});
2528

2629
const renderContent = () => {

src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.tsx

+28-2
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ import {
66
TriangleExclamationFill,
77
} from '@gravity-ui/icons';
88
import type {IconData} from '@gravity-ui/uikit';
9-
import {Icon} from '@gravity-ui/uikit';
9+
import {Icon, Popover} from '@gravity-ui/uikit';
1010

1111
import {DiagnosticCard} from '../../../../../components/DiagnosticCard/DiagnosticCard';
1212
import {ResponseError} from '../../../../../components/Errors/ResponseError';
1313
import {Loader} from '../../../../../components/Loader';
14+
import {useClusterBaseInfo} from '../../../../../store/reducers/cluster/cluster';
1415
import {healthcheckApi} from '../../../../../store/reducers/healthcheckInfo/healthcheckInfo';
1516
import {SelfCheckResult} from '../../../../../types/api/healthcheck';
1617
import {cn} from '../../../../../utils/cn';
1718
import {useAutoRefreshInterval} from '../../../../../utils/hooks';
1819

1920
import i18n from './i18n';
2021

22+
import CircleExclamationIcon from '@gravity-ui/icons/svgs/circle-exclamation.svg';
23+
2124
import './Healthcheck.scss';
2225

2326
const b = cn('healthcheck');
@@ -38,14 +41,21 @@ const icons: Record<SelfCheckResult, IconData> = {
3841
export function HealthcheckPreview(props: HealthcheckPreviewProps) {
3942
const {tenantName, active} = props;
4043
const [autoRefreshInterval] = useAutoRefreshInterval();
44+
45+
const {name} = useClusterBaseInfo();
46+
const healthcheckPreviewAutorefreshDisabled = name === 'ydb_ru';
47+
4148
const {
4249
currentData: data,
4350
isFetching,
4451
error,
4552
} = healthcheckApi.useGetHealthcheckInfoQuery(
4653
{database: tenantName},
4754
{
48-
pollingInterval: autoRefreshInterval,
55+
//FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889
56+
pollingInterval: healthcheckPreviewAutorefreshDisabled
57+
? undefined
58+
: autoRefreshInterval,
4959
},
5060
);
5161

@@ -56,6 +66,22 @@ export function HealthcheckPreview(props: HealthcheckPreviewProps) {
5666
<div className={b('preview-header')}>
5767
<div className={b('preview-title-wrapper')}>
5868
<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}
5985
</div>
6086
</div>
6187
);

0 commit comments

Comments
 (0)