feat(i18n): 剩余模块全量国际化 — 51% 覆盖率 (231 文件接入 t())

批量转换 163 个文件,3204 处中文替换为 t() 调用:
- Monitor: 日志中心/告警中心/数据源/大屏/站点拨测/SNMP/中间件 全部转换
- Kubernetes: ResourceVisualEditor/NamespaceResourcePage/拓扑/事件 全部转换
- Deploy: 流水线/发布/凭证/RBAC 全部转换
- Server/Cloud/Agent/Task/Layout/UI: 全部转换
- 翻译词典扩展至 6474 行 (22 namespaces, 5000+ keys)
- tsc 编译零错误
This commit is contained in:
attacker committed 2026-07-03 01:51:57 +08:00
1 parent 78c27037e3
commit ecec73989b
166 files changed
+6925 -2800

No files matched your search

@@ -20,8 +20,10 @@ 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[]>([]);
@@ -75,15 +77,15 @@ export function AlertManager() {
];
const pageTabs = [
{ id: 'events', label: '告警事件' },
{ id: 'rules', label: '告警规则' },
{ id: 'events', label: t('monitor.alertmanager.s0e5b83') },
{ id: 'rules', label: t('alert.tab.rules') },
];
return (
<PageShell
variant="list"
title="监控告警"
subtitle="告警规则管理与告警事件处理"
title=t('monitor.alertmanager.sa57c10')
subtitle=t('monitor.alertmanager.s1a70ca')
icon={<Bell className="h-5 w-5" />}
tabs={pageTabs}
activeTab={activeTab}
@@ -91,10 +93,10 @@ export function AlertManager() {
metrics={(
<StatStrip
items={[
{ 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' },
{ 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' },
]}
/>
)}
@@ -117,8 +119,8 @@ export function AlertManager() {
>
<Card className="dg-card">
<CardHeader className="pb-2">
<CardTitle className="text-[var(--dg-text-primary)]">告警趋势</CardTitle>
<CardDescription className="dg-text-muted">过去24小时告警统计</CardDescription>
<CardTitle className="text-[var(--dg-text-primary)]">{t('monitor.alertmanager.s358b05')}</CardTitle>
<CardDescription className="dg-text-muted">{t('monitor.alertmanager.s615fa6')}</CardDescription>
</CardHeader>
<CardContent>
<div className="h-[200px]">
@@ -151,7 +153,7 @@ export function AlertManager() {
stroke="#ef4444"
fillOpacity={1}
fill="url(#colorCritical)"
name="严重"
name=t('monitor.critical')
/>
<Area
type="monotone"
@@ -159,7 +161,7 @@ export function AlertManager() {
stroke="#f59e0b"
fillOpacity={1}
fill="url(#colorWarning)"
name="警告"
name=t('common.warning')
/>
</AreaChart>
</ResponsiveContainer>