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

@@ -15,6 +15,7 @@ import {
SNMP_TIME_RANGE_HOURS, fmtMetricValue, isSnmpCounterMetric, metricColor, pickSeriesByCategory,
} from './helpers';
import { SnmpMetricTrendChart } from './SnmpMetricTrendChart';
import { useTranslation } from 'react-i18next';
interface Props {
device: SnmpDevice | null;
@@ -29,6 +30,7 @@ interface ChartBlock {
}
export function SnmpDeviceChartsPanel({ device, templateName }: Props) {
const { t } = useTranslation();
const [timeRange, setTimeRange] = useState<SnmpTimeRange>('24h');
const [series, setSeries] = useState<SnmpMetricSeries[]>([]);
const [charts, setCharts] = useState<ChartBlock[]>([]);
@@ -114,9 +116,9 @@ export function SnmpDeviceChartsPanel({ device, templateName }: Props) {
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="6h">近 6 小时</SelectItem>
<SelectItem value="24h">近 24 小时</SelectItem>
<SelectItem value="7d">近 7 天</SelectItem>
<SelectItem value="6h">{t('monitor.siteProtocol.rangeDefault')}</SelectItem>
<SelectItem value="24h">{t('monitor.snmpdevicechartspanel.s6e99b7')}</SelectItem>
<SelectItem value="7d">{t('monitor.snmpdevicechartspanel.sd765ef')}</SelectItem>
</SelectContent>
</Select>
<Button variant="outline" size="sm" className="h-7 text-xs" onClick={loadCharts} disabled={loading}>
@@ -128,9 +130,9 @@ export function SnmpDeviceChartsPanel({ device, templateName }: Props) {
<div className="grid grid-cols-3 gap-3 mb-4">
{[
{ label: '最新 CPU', value: latestCpu ? fmtMetricValue(latestCpu.latest_value, latestCpu.unit || '%') : '--' },
{ label: '最新内存', value: latestMem ? fmtMetricValue(latestMem.latest_value, latestMem.unit || '%') : '--' },
{ label: '数据保留', value: '7 天' },
{ label: t('monitor.snmpdevicechartspanel.s53a041'), value: latestCpu ? fmtMetricValue(latestCpu.latest_value, latestCpu.unit || '%') : '--' },
{ label: t('monitor.snmpdevicechartspanel.s33962a'), value: latestMem ? fmtMetricValue(latestMem.latest_value, latestMem.unit || '%') : '--' },
{ label: t('monitor.snmpdevicechartspanel.s26bddc'), value: t('monitor.snmpdevicechartspanel.sfdef8c') },
].map((item) => (
<div key={item.label} className="rounded-lg bg-[var(--dg-bg-tertiary)] p-3 text-center">
<p className="text-[10px] text-[var(--dg-text-muted)]">{item.label}</p>