mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 06:32:17 +08:00

* Update the generator to include version * Add versioned APIs * Update imports * Prettier
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { Trans, t } from '@grafana/i18n';
|
|
import { Stack, Alert, Text } from '@grafana/ui';
|
|
import { HealthStatus } from 'app/api/clients/provisioning/v0alpha1';
|
|
|
|
interface Props {
|
|
health: HealthStatus;
|
|
}
|
|
|
|
export function RepositoryHealth({ health }: Props) {
|
|
return (
|
|
<Stack gap={2} direction="column" alignItems="flex-start">
|
|
{health.healthy ? (
|
|
<Alert
|
|
title={t('provisioning.repository-health.title-repository-is-healthy', 'Repository is healthy')}
|
|
severity="success"
|
|
style={{ width: '100%' }}
|
|
>
|
|
<Trans i18nKey="provisioning.repository-health.no-errors-found">No errors found</Trans>
|
|
</Alert>
|
|
) : (
|
|
<Alert
|
|
title={t('provisioning.repository-health.title-repository-is-unhealthy', 'Repository is unhealthy')}
|
|
severity="warning"
|
|
style={{ width: '100%' }}
|
|
>
|
|
{health.message && health.message.length > 0 && (
|
|
<>
|
|
<Text>
|
|
<Trans i18nKey="provisioning.repository-health.details">Details:</Trans>
|
|
</Text>
|
|
<ul>
|
|
{health.message.map((message) => (
|
|
<li key={message}>{message}</li>
|
|
))}
|
|
</ul>
|
|
</>
|
|
)}
|
|
</Alert>
|
|
)}
|
|
</Stack>
|
|
);
|
|
}
|