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

@@ -8,6 +8,7 @@ import { Input } from '@/components/ui/input';
import { Badge } from '@/components/ui/badge';
import { CreateHPADialog } from './CreateHPADialog';
import type { JsonData } from '@/types/common';
import { useTranslation } from 'react-i18next';
export interface DeploymentOverviewProps {
deploymentName: string;
@@ -37,6 +38,7 @@ export function DeploymentOverview({
newImage, showImageUpdate, onBack, onRefresh, onScale, onRestart,
onNewImageChange, onToggleImageUpdate, onUpdateImage,
}: DeploymentOverviewProps) {
const { t } = useTranslation();
return (
<>
<div className="flex items-center justify-between">
@@ -60,7 +62,7 @@ export function DeploymentOverview({
<div className="grid grid-cols-2 md:grid-cols-4 gap-3">
<Card className="dg-card">
<CardContent className="p-3">
<p className="text-xs dg-text-muted">副本状态</p>
<p className="text-xs dg-text-muted">{t('kubernetes.deploymentoverview.sb4cac1')}</p>
<p className={`text-lg font-bold ${isHealthy ? 'dg-text-green' : 'dg-text-yellow'}`}>
{ready}/{total}
</p>
@@ -68,13 +70,13 @@ export function DeploymentOverview({
</Card>
<Card className="dg-card">
<CardContent className="p-3">
<p className="text-xs dg-text-muted">可用副本</p>
<p className="text-xs dg-text-muted">{t('k8s.column.availableReplicas')}</p>
<p className="text-lg font-bold dg-text-blue">{available}</p>
</CardContent>
</Card>
<Card className="dg-card">
<CardContent className="p-3">
<p className="text-xs dg-text-muted">镜像</p>
<p className="text-xs dg-text-muted">{t('k8s.column.image')}</p>
<p className="text-sm font-mono text-[var(--dg-text-secondary)] truncate max-w-[200px]" title={deployment.image}>
{deployment.image?.split('/').pop() || '-'}
</p>
@@ -84,10 +86,10 @@ export function DeploymentOverview({
<CardContent className="p-3">
<p className="text-xs dg-text-muted">HPA</p>
{hpas.length > 0 ? (
<p className="text-lg font-bold dg-text-purple">已启用</p>
<p className="text-lg font-bold dg-text-purple">{t('alert.enabled')}</p>
) : (
<div className="flex items-center justify-between">
<p className="text-lg font-bold dg-text-muted">未配置</p>
<p className="text-lg font-bold dg-text-muted">{t('k8s.dnsHost.notConfigured')}</p>
<CreateHPADialog
clusterCode={clusterCode}
namespace={namespace}
@@ -102,7 +104,7 @@ export function DeploymentOverview({
<Card className="dg-card">
<CardHeader className="pb-3">
<CardTitle className="text-base text-[var(--dg-text-primary)]">操作</CardTitle>
<CardTitle className="text-base text-[var(--dg-text-primary)]">{t('common.actions')}</CardTitle>
</CardHeader>
<CardContent>
<div className="flex flex-wrap items-center gap-3">
@@ -146,16 +148,16 @@ export function DeploymentOverview({
<Input
value={newImage}
onChange={(e) => onNewImageChange(e.target.value)}
placeholder="输入新镜像地址,如 harbor.example.com/app:v2.0"
placeholder=t('kubernetes.deploymentoverview.s416d7e')
className="flex-1 h-9 dg-input text-[var(--dg-text-primary)] text-sm font-mono"
/>
<Button size="sm" className="bg-blue-600 hover:bg-blue-700"
disabled={actionLoading === 'image' || !newImage.trim()}
onClick={onUpdateImage}
>
{actionLoading === 'image' ? <Loader2 className="h-4 w-4 animate-spin" /> : '更新'}
{actionLoading === 'image' ? <Loader2 className="h-4 w-4 animate-spin" /> : t('common.update')}
</Button>
<Button variant="ghost" size="sm" className="dg-text-secondary" onClick={onToggleImageUpdate}>取消</Button>
<Button variant="ghost" size="sm" className="dg-text-secondary" onClick={onToggleImageUpdate}>{t('common.cancel')}</Button>
</div>
)}
</CardContent>