fix(i18n): U30 修复 8 处批量 i18n 转换损坏的调用 — DeploymentEditContainers/DeploymentEditStorage/AgentRuleDialog/LogFieldSidebar
损坏原因: 早期批量正则 i18n 转换 (U20 记录的 i18n.t() 损坏模式遗留) 将模板表达式/JSX
碎片错误包裹进 i18n.t() 调用, 产生运行时垃圾文本渲染.
修复清单:
- DeploymentEditContainers.tsx:85 — toast 调用 description 字段损坏 (i18n.t('), description: ...'))
- DeploymentEditStorage.tsx:175 — !manifest 空状态文案损坏
- DeploymentEditStorage.tsx:202 — 数据卷卡片副标题损坏
- AgentRuleDialog.tsx:111 — DialogDescription 损坏 (i18n.t('>阈值 {ruleForm.metric !== '))
- AgentRuleDialog.tsx:157 — 操作符 Label 损坏
- AgentRuleDialog.tsx:183 — 端口 Label 损坏
- AgentRuleDialog.tsx:195 — 持续时间 Label 损坏
- LogFieldSidebar.tsx:68 — 搜索框 placeholder 损坏
新增 i18n 键 (zh/en 对齐 7370→7376 +6):
- agent.ruleDialog.description / operator / port / duration
- kubernetes.storage.volumeDesc
- monitor.lbl.searchFields
验证: tsc -b=0, npm build✓ (17.99s), ESLint=0/53/0, go build=0, 17/17 测试通过
This commit is contained in:
1 parent
064b6c4ec2
commit
3039b76cb5
6 files changed
+29
-17
No files matched your search
@@ -82,7 +82,7 @@ export function DeploymentEditContainers({ clusterCode, namespace, deploymentNam
|
||||
// validate
|
||||
for (const c of [...initContainers, ...containers]) {
|
||||
if (!c.name.trim()) {
|
||||
toast({ title: i18n.t('kubernetes.msg.saveFailed'), description: i18n.t('), description: `容器 ${c.name} 的镜像不能为空`, variant: '), variant: 'destructive' });
|
||||
toast({ title: i18n.t('kubernetes.msg.saveFailed'), description: '容器名称不能为空', variant: 'destructive' });
|
||||
return;
|
||||
}
|
||||
if (!c.image.trim()) {
|
||||
|
||||
@@ -172,7 +172,7 @@ export function DeploymentEditStorage({ clusterCode, namespace, deploymentName,
|
||||
if (!manifest) {
|
||||
return (
|
||||
<Card className="dg-card">
|
||||
<CardContent className="p-8 text-center dg-text-muted"> {i18n.t('), description: `请为「${entry.volume.name}」${hint}`, variant: ')} </CardContent>
|
||||
<CardContent className="p-8 text-center dg-text-muted"> {i18n.t('kubernetes.storage.noManifest')} </CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ export function DeploymentEditStorage({ clusterCode, namespace, deploymentName,
|
||||
数据卷
|
||||
<Badge variant="outline" className="border-[var(--dg-border)] dg-text-secondary">{entries.length}</Badge>
|
||||
</CardTitle>
|
||||
<p className="text-[11px] dg-text-muted mt-1"> {i18n.t('), description: `请为「${entry.volume.name}」${hint}`, variant: ')} </p>
|
||||
<p className="text-[11px] dg-text-muted mt-1"> {i18n.t('kubernetes.storage.volumeDesc')} </p>
|
||||
</div>
|
||||
<Button size="sm" variant="outline" className="h-7 border-[var(--dg-border)] text-[var(--dg-text-secondary)] text-xs shrink-0" onClick={addEntry}>
|
||||
<Plus className="h-3 w-3 mr-1" />添加数据卷
|
||||
|
||||
Reference in new issue
Block a user