Skip to content

fix: disable autorefresh for ydb_ru #1890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,10 @@

border-radius: 4px;
}
&__icon-warn {
color: var(--g-color-text-warning);
}
&__icon-wrapper {
display: flex;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';

import {ResponseError} from '../../../../../components/Errors/ResponseError';
import {Loader} from '../../../../../components/Loader';
import {useClusterBaseInfo} from '../../../../../store/reducers/cluster/cluster';
import {cn} from '../../../../../utils/cn';
import {useAutoRefreshInterval} from '../../../../../utils/hooks';
import {useHealthcheck} from '../useHealthcheck';
Expand All @@ -19,8 +20,10 @@ interface HealthcheckDetailsProps {

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

const renderContent = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ import {
TriangleExclamationFill,
} from '@gravity-ui/icons';
import type {IconData} from '@gravity-ui/uikit';
import {Icon} from '@gravity-ui/uikit';
import {Icon, Popover} from '@gravity-ui/uikit';

import {DiagnosticCard} from '../../../../../components/DiagnosticCard/DiagnosticCard';
import {ResponseError} from '../../../../../components/Errors/ResponseError';
import {Loader} from '../../../../../components/Loader';
import {useClusterBaseInfo} from '../../../../../store/reducers/cluster/cluster';
import {healthcheckApi} from '../../../../../store/reducers/healthcheckInfo/healthcheckInfo';
import {SelfCheckResult} from '../../../../../types/api/healthcheck';
import {cn} from '../../../../../utils/cn';
import {useAutoRefreshInterval} from '../../../../../utils/hooks';

import i18n from './i18n';

import CircleExclamationIcon from '@gravity-ui/icons/svgs/circle-exclamation.svg';

import './Healthcheck.scss';

const b = cn('healthcheck');
Expand All @@ -38,14 +41,21 @@ const icons: Record<SelfCheckResult, IconData> = {
export function HealthcheckPreview(props: HealthcheckPreviewProps) {
const {tenantName, active} = props;
const [autoRefreshInterval] = useAutoRefreshInterval();

const {name} = useClusterBaseInfo();
const healthcheckPreviewAutorefreshDisabled = name === 'ydb_ru';

const {
currentData: data,
isFetching,
error,
} = healthcheckApi.useGetHealthcheckInfoQuery(
{database: tenantName},
{
pollingInterval: autoRefreshInterval,
//FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889
pollingInterval: healthcheckPreviewAutorefreshDisabled
? undefined
: autoRefreshInterval,
},
);

Expand All @@ -56,6 +66,22 @@ export function HealthcheckPreview(props: HealthcheckPreviewProps) {
<div className={b('preview-header')}>
<div className={b('preview-title-wrapper')}>
<div className={b('preview-title')}>{i18n('title.healthcheck')}</div>
{/* FIXME https://github.com/ydb-platform/ydb-embedded-ui/issues/1889 */}
{autoRefreshInterval && healthcheckPreviewAutorefreshDisabled ? (
<Popover
content={'Autorefresh is disabled. Please update healthcheck manually.'}
placement={['top']}
className={b('icon-wrapper')}
>
{() => (
<Icon
size={16}
className={b('icon-warn')}
data={CircleExclamationIcon}
/>
)}
</Popover>
) : null}
</div>
</div>
);
Expand Down
Loading