fix(i18n): 回退到稳定的 32% 覆盖率状态 (tsc + Vite 构建通过)

批量转换脚本引入的语法错误已回退,保留稳定的 i18n 转换:
- 翻译词典: 22 namespaces, 3600+ keys
- 已接入: 145+ 文件 (Dashboard/Login/K8s 主页面/Monitor/System/Deploy)
- 语言切换器在 Header 中可用 (🇨🇳/🇺🇸)
- tsc 零错误, Vite 构建成功
This commit is contained in:
attacker committed 2026-07-03 02:02:29 +08:00
1 parent ecec73989b
commit 72bfb0e12d
191 files changed
+5057 -7592

No files matched your search

@@ -20,10 +20,8 @@ import { PageShell } from '@/components/layout/PageShell';
import { StatStrip } from '@/components/ui/stat-strip';
import type { JsonData } from '@/types/common';
import type { AlertEventRecord, AlertRuleRecord, AlertChannel } from '@/types';
import { useTranslation } from 'react-i18next';
export function AlertManager() {
const { t } = useTranslation();
const [activeTab, setActiveTab] = useState('events');
const [alerts, setAlerts] = useState<AlertEventRecord[]>([]);
const [rules, setRules] = useState<AlertRuleRecord[]>([]);
@@ -77,15 +75,15 @@ export function AlertManager() {
];
const pageTabs = [
{ id: 'events', label: t('monitor.alertmanager.s0e5b83') },
{ id: 'rules', label: t('alert.tab.rules') },
{ id: 'events', label: '告警事件' },
{ id: 'rules', label: '告警规则' },
];
return (
<PageShell
variant="list"
title=t('monitor.alertmanager.sa57c10')
subtitle=t('monitor.alertmanager.s1a70ca')
title="监控告警"
subtitle="告警规则管理与告警事件处理"
icon={<Bell className="h-5 w-5" />}
tabs={pageTabs}
activeTab={activeTab}
@@ -93,10 +91,10 @@ export function AlertManager() {
metrics={(
<StatStrip
items={[
{ label: t('alert.tab.rules'), value: rules.length, color: 'blue' },
{ label: t('monitor.firing'), value: alerts.filter((e) => e.status === 'firing').length, color: 'red' },
{ label: t('monitor.alertmanager.s240597'), value: alerts.length, color: 'amber' },
{ label: t('kubernetes.deployment.resumed'), value: alerts.filter((e) => e.status === 'resolved').length, color: 'emerald' },
{ label: '告警规则', value: rules.length, color: 'blue' },
{ label: '触发中', value: alerts.filter((e) => e.status === 'firing').length, color: 'red' },
{ label: '今日告警', value: alerts.length, color: 'amber' },
{ label: '已恢复', value: alerts.filter((e) => e.status === 'resolved').length, color: 'emerald' },
]}
/>
)}
@@ -119,8 +117,8 @@ export function AlertManager() {
>
<Card className="dg-card">
<CardHeader className="pb-2">
<CardTitle className="text-[var(--dg-text-primary)]">{t('monitor.alertmanager.s358b05')}</CardTitle>
<CardDescription className="dg-text-muted">{t('monitor.alertmanager.s615fa6')}</CardDescription>
<CardTitle className="text-[var(--dg-text-primary)]">告警趋势</CardTitle>
<CardDescription className="dg-text-muted">过去24小时告警统计</CardDescription>
</CardHeader>
<CardContent>
<div className="h-[200px]">
@@ -153,7 +151,7 @@ export function AlertManager() {
stroke="#ef4444"
fillOpacity={1}
fill="url(#colorCritical)"
name=t('monitor.critical')
name="严重"
/>
<Area
type="monotone"
@@ -161,7 +159,7 @@ export function AlertManager() {
stroke="#f59e0b"
fillOpacity={1}
fill="url(#colorWarning)"
name=t('common.warning')
name="警告"
/>
</AreaChart>
</ResponsiveContainer>