diff --git a/frontend/src/i18n/locales/en/settings.ts b/frontend/src/i18n/locales/en/settings.ts index 702b753..6e8fad3 100644 --- a/frontend/src/i18n/locales/en/settings.ts +++ b/frontend/src/i18n/locales/en/settings.ts @@ -3,11 +3,8 @@ export default { retention: { title: 'Log retention', - desc: 'How long the platform keeps its own records. Loki log retention itself is configured per deployment (Component Deploy → Retention).', - alertLabel: 'Alert delivery history (days)', - alertHint: 'Expired records are purged automatically; default 7 days', + alertLabel: 'Alert history (days)', auditLabel: 'Audit logs (days)', - auditHint: '90–180 days recommended for compliance', save: 'Save', saving: 'Saving…', saved: 'Retention saved; expired records purged', diff --git a/frontend/src/i18n/locales/zh/settings.ts b/frontend/src/i18n/locales/zh/settings.ts index 766c421..94d535f 100644 --- a/frontend/src/i18n/locales/zh/settings.ts +++ b/frontend/src/i18n/locales/zh/settings.ts @@ -3,11 +3,8 @@ export default { retention: { title: '日志保留时间', - desc: '平台自身数据的保留期。注意:Loki 日志本身的保留期在「组件部署 → 保留策略」里配置。', - alertLabel: '告警发送历史(天)', - alertHint: '过期记录自动清理,默认 7 天', + alertLabel: '告警历史(天)', auditLabel: '审计日志(天)', - auditHint: '合规场景建议 90~180 天', save: '保存', saving: '保存中…', saved: '保留策略已保存,过期数据已清理', diff --git a/frontend/src/pages/settings/components/RetentionSection.tsx b/frontend/src/pages/settings/components/RetentionSection.tsx index 1bfb0ff..eeb40dc 100644 --- a/frontend/src/pages/settings/components/RetentionSection.tsx +++ b/frontend/src/pages/settings/components/RetentionSection.tsx @@ -2,7 +2,6 @@ import { memo, useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { systemApi, type RetentionSettings } from '@/api/system' import { toast } from 'sonner' @@ -47,53 +46,39 @@ export const RetentionSection = memo(function RetentionSection() { } }, [settings, t]) + // 紧凑单行分区(与主题/语言同族):标签 + 两个数字输入 + 内联保存,不再嵌套整卡 return ( - - - {t('retention.title')} -

{t('retention.desc')}

-
- -
-
- - setSettings(s => ({ ...s, alertDeliveryDays: Number(e.target.value) || 0 }))} - /> -

{t('retention.alertHint')}

-
-
- - setSettings(s => ({ ...s, auditLogDays: Number(e.target.value) || 0 }))} - /> -

{t('retention.auditHint')}

-
-
-
- -
-
-
+
+ {t('retention.title')} + + + +
) }) diff --git a/frontend/src/pages/settings/index.tsx b/frontend/src/pages/settings/index.tsx index 636eacc..29150f0 100644 --- a/frontend/src/pages/settings/index.tsx +++ b/frontend/src/pages/settings/index.tsx @@ -81,9 +81,9 @@ const SettingsPage = memo(function SettingsPage() { - +