refactor(i18n): U31 AIOps Agent CLI 组件 i18n 修复 — Q7/Q35 拆分后丢失的 i18n 集成全部修复

6 个文件迁移 (AgentCLI + AgentCLIToolbar + AgentCLIHistory + AgentCLIEmptyState + ChatInputArea + agent-cli-constants.ts):
- 新增 aiops.cli.* 命名空间 100 翻译键 (10 子分类)
- SAFETY_MODES/TIPS_HOST/TIPS_KUBERNETES 常量改为 getSafetyModes(t)/getTipsHost(t)/getTipsKubernetes(t) 工厂函数
- 全部 UI 硬编码中文清零 (66→0)
- zh/en 7381→7481 +100 键对齐
- tsc -b=0, npm build✓ (18.21s), ESLint=0/53/0, go build=0, 17/17 测试通过
This commit is contained in:
attacker committed 2026-07-12 12:17:47 +08:00
1 parent 6dfddb426c
commit 4f2d279865
9 files changed
+461 -128

No files matched your search

+133 -1
View File
@@ -7886,7 +7886,139 @@
"predictIn7d": "In 7 days",
"predictIn30d": "In 30 days",
"agentCliErrorOccurred": "Error occurred",
"agentCliNoOutput": "(no output)"
"agentCliNoOutput": "(no output)",
"cli": {
"host": "Host",
"toolbar": {
"selectServer": "Select target host",
"cluster": "Cluster",
"namespace": "Namespace",
"podOptional": "Pod (optional)",
"podSearch": "Search Pod name",
"podNone": "No Pod selected (cluster/NS level tasks)",
"podNoMatch": "No matching Pods",
"safetyTitle": "Safety Mode Description",
"safetyDesc": "Controls whether you need to confirm before AI executes remote commands. Dangerous commands are always blocked in all modes.",
"safetyRecommended": "Recommended",
"safetyExample": "e.g.",
"historyExpand": "Expand history tasks",
"historyCollapse": "Collapse history tasks",
"historyLabel": "History",
"connected": "Connected",
"viewRecord": "View Record",
"canContinue": "Can Continue",
"capabilitiesTitle": "Core Capabilities",
"capabilitiesTooltip": "Core Capabilities",
"round": "Round {{round}} / {{tokens}}t"
},
"safety": {
"strict": {
"label": "Strict",
"short": "Medium risk + confirm",
"desc": "Medium-risk and above commands (chmod, file modifications, service restarts) require confirmation. Suitable for production or unfamiliar hosts.",
"examples": "chmod, mv, systemctl restart"
},
"balanced": {
"label": "Balanced",
"short": "High risk + confirm",
"desc": "Daily troubleshooting commands (viewing logs, ps, df) run automatically; only high-risk operations like file deletion or service restarts require confirmation. Recommended for daily use.",
"examples": "cat/grep/df auto / rm/reboot confirm"
},
"permissive": {
"label": "Permissive",
"short": "Block danger only",
"desc": "Except for dangerous commands which are hard-blocked, everything else runs automatically. Only suitable for isolated test environments.",
"examples": "rm -rf / blocked / rest auto"
}
},
"tips": {
"host": {
"llmTitle": "LLM + Tool Layer",
"llmDesc": "OpenAI-compatible LLM; tools include ssh_execute (remote execution) and analyze_output (output analysis).",
"shieldTitle": "Security + Prompt",
"shieldDesc": "Five-level risk assessment + three-level safety mode; dangerous commands hard-rejected, high-risk commands require confirmation.",
"brainTitle": "ReAct Core Engine",
"brainDesc": "Think-Act-Observe loop (max 16 rounds), retries with different approaches on failure, loop detection prevents infinite loops.",
"dbTitle": "Self-Evolution Engine",
"dbDesc": "Four-layer memory async learning, automatically injects historical experience for similar tasks, gets smarter with use."
},
"k8s": {
"cloudTitle": "Kubernetes Query",
"cloudDesc": "kubernetes_get unified query for nodes/Pods/Deployments/events; pod_logs fetches container logs.",
"terminalTitle": "Pod Execution",
"terminalDesc": "After selecting a Pod, use pod_execute to enter the container for troubleshooting; kubernetes_action performs restarts/scaling and other changes.",
"shieldTitle": "Security + ReAct",
"shieldDesc": "Read-only tools run automatically; changes and dangerous commands require confirmation, max 16 rounds of troubleshooting.",
"dbTitle": "Self-Evolution Engine",
"dbDesc": "Learns per cluster/namespace bucket, Kubernetes troubleshooting tasks become more accurate with use."
}
},
"subtitleHost": "Natural language driven SSH autonomous troubleshooting and deployment",
"subtitleK8s": "Natural language driven Kubernetes cluster queries and Pod troubleshooting",
"error": {
"connectTimeoutK8s": "Cluster connection timeout: please check cluster credentials and LLM configuration and retry.",
"connectTimeoutHost": "Host connection timeout: please check SSH credentials and LLM configuration and retry.",
"connectRejectedK8s": "Cluster connection rejected: please check cluster kubeconfig/token configuration and whether LLM is enabled.",
"connectRejectedHost": "Host connection rejected: please confirm SSH credentials and LLM configuration and retry.",
"selectServer": "Please select a target host first",
"selectCluster": "Please select a cluster and namespace first",
"notReady": "Connection not ready, please check LLM configuration or refresh the page",
"notReadyRetry": "Connection not ready, please try again later"
},
"info": {
"connectionClosed": "Connection closed",
"viewHistory": "Viewing history: {{title}} ({{status}}) - read-only, click \"Continue\" to resume execution",
"resuming": "Resuming session \"{{title}}\"..."
},
"statusDone": "Completed",
"viewMode": {
"readOnly": "History (read-only) - {{title}}",
"continueBtn": "Continue",
"newTask": "New Task"
},
"placeholder": {
"viewMode": "View mode, click \"Continue\" or \"New Task\"",
"continueInput": "Continue, press Enter to send (Shift+Enter for new line)",
"inputTask": "Describe your task, press Enter to send (Shift+Enter for new line)",
"selectClusterNs": "Please select a cluster and namespace first",
"selectServerShort": "Please select a target host first"
},
"history": {
"loadFailed": "Failed to load history sessions",
"detailFailed": "Failed to load session details",
"deleteTitle": "Delete Session",
"deleteDesc": "Are you sure you want to delete \"{{title}}\"? This action cannot be undone.",
"deleted": "Deleted",
"deleteFailed": "Delete failed",
"label": "History",
"newBtn": "New",
"collapseHistory": "Collapse history",
"selectK8s": "Select cluster and namespace to view",
"selectHost": "Select a host to view",
"noHistory": "No history",
"viewHistory": "View history record",
"rounds": "{{rounds}} rounds / {{tokens}}t",
"statusDone": "Done",
"statusRunning": "Running",
"statusAborted": "Aborted",
"statusError": "Error"
},
"empty": {
"selectK8s": "Please select a cluster and namespace first",
"selectHost": "Please select a target host first",
"connectingK8s": "Connecting to cluster...",
"connectingHost": "Connecting to host...",
"readyK8s": "Describe a Kubernetes troubleshooting task, e.g. \"Check NotReady nodes\" or \"Analyze nginx Pod restart cause\"",
"readyHost": "Describe the task you want to execute, e.g. \"Check disk usage and clean up large files\"",
"currentSafety": "Current safety mode: {{label}} ({{short}})",
"noPod": " / No Pod selected, cluster/NS level queries only"
},
"input": {
"hint": "Shift+Enter for new line / Enter to send",
"stop": "Stop",
"execute": "Run"
}
}
},
"breadcrumb": {
"dashboard": "Dashboard",
+133 -1
View File
@@ -7886,7 +7886,139 @@
"predictIn7d": "7天后",
"predictIn30d": "30天后",
"agentCliErrorOccurred": "发生错误",
"agentCliNoOutput": "(无输出)"
"agentCliNoOutput": "(无输出)",
"cli": {
"host": "主机",
"toolbar": {
"selectServer": "选择目标主机",
"cluster": "集群",
"namespace": "命名空间",
"podOptional": "Pod(可选)",
"podSearch": "搜索 Pod 名称",
"podNone": "不选定 Pod(集群/NS 级任务)",
"podNoMatch": "无匹配 Pod",
"safetyTitle": "安全模式说明",
"safetyDesc": "控制 AI 执行远程命令前是否需要你确认。危险命令(如 rm -rf /)任何模式均硬性拦截。",
"safetyRecommended": "推荐",
"safetyExample": "例",
"historyExpand": "展开历史任务",
"historyCollapse": "收起历史任务",
"historyLabel": "历史",
"connected": "已连接",
"viewRecord": "查看记录",
"canContinue": "可追问",
"capabilitiesTitle": "核心能力",
"capabilitiesTooltip": "核心能力说明",
"round": "第 {{round}} 轮 · {{tokens}}t"
},
"safety": {
"strict": {
"label": "严格",
"short": "中风险+确认",
"desc": "chmod、文件修改、服务重启等中风险及以上命令均需弹框确认。适合生产环境或不熟悉的主机。",
"examples": "chmod、mv、systemctl restart"
},
"balanced": {
"label": "均衡",
"short": "高风险+确认",
"desc": "日常排障命令(查看日志、ps、df)自动执行;删除文件、重启服务等高风险操作才需确认。推荐日常使用。",
"examples": "cat/grep/df 自动 · rm/reboot 确认"
},
"permissive": {
"label": "宽松",
"short": "仅拦截危险",
"desc": "除 rm -rf /、mkfs 等危险命令硬性拦截外,其余全部自动执行。仅适合隔离测试环境。",
"examples": "rm -rf / 拦截 · 其余自动"
}
},
"tips": {
"host": {
"llmTitle": "LLM + 工具层",
"llmDesc": "OpenAI 兼容 LLM;工具含 ssh_execute(远程执行)与 analyze_output(输出分析)。",
"shieldTitle": "安全 + Prompt",
"shieldDesc": "五级风险评估 + 三级安全模式;危险命令硬性拒绝,高危命令弹框确认。",
"brainTitle": "ReAct 核心引擎",
"brainDesc": "思考→行动→观察循环(最多 16 轮),失败换法重试,循环检测防死循环。",
"dbTitle": "自进化引擎",
"dbDesc": "四层记忆异步学习,同类任务自动注入历史经验,越用越聪明。"
},
"k8s": {
"cloudTitle": "Kubernetes 查询",
"cloudDesc": "kubernetes_get 统一查询节点/Pod/Deployment/事件等;pod_logs 拉取容器日志。",
"terminalTitle": "Pod 执行",
"terminalDesc": "选定 Pod 后可用 pod_execute 进入容器排障;kubernetes_action 执行重启/扩缩容等变更。",
"shieldTitle": "安全 + ReAct",
"shieldDesc": "只读工具自动执行;变更与危险命令弹框确认,最多 16 轮循环排障。",
"dbTitle": "自进化引擎",
"dbDesc": "按集群/命名空间分桶学习,同类 Kubernetes 排障任务越用越准。"
}
},
"subtitleHost": "自然语言驱动 SSH 自主排障与部署",
"subtitleK8s": "自然语言驱动 Kubernetes 集群查询与 Pod 排障",
"error": {
"connectTimeoutK8s": "连接集群超时:请检查集群凭据与大模型配置后重试。",
"connectTimeoutHost": "连接主机超时:请检查 SSH 凭据与大模型配置后重试。",
"connectRejectedK8s": "集群连接被拒绝:请检查集群 kubeconfig/token 配置与大模型是否启用。",
"connectRejectedHost": "主机连接被拒绝:请确认 SSH 凭据与大模型配置后重试。",
"selectServer": "请先选择目标主机",
"selectCluster": "请先选择集群和命名空间",
"notReady": "连接未就绪,请检查大模型配置或刷新页面重试",
"notReadyRetry": "连接未就绪,请稍后重试"
},
"info": {
"connectionClosed": "连接已关闭",
"viewHistory": "查看历史记录:{{title}}({{status}})— 仅浏览,点击「继续追问」可在此基础上接着执行",
"resuming": "正在恢复会话「{{title}}」…"
},
"statusDone": "已完成",
"viewMode": {
"readOnly": "历史记录(只读)· {{title}}",
"continueBtn": "继续追问",
"newTask": "新建任务"
},
"placeholder": {
"viewMode": "查看模式中,点击「继续追问」或「新建任务」",
"continueInput": "继续追问,回车发送(Shift+回车换行)",
"inputTask": "输入任务描述,回车发送(Shift+回车换行)",
"selectClusterNs": "请先选择集群和命名空间",
"selectServerShort": "请先选择目标主机"
},
"history": {
"loadFailed": "加载历史会话失败",
"detailFailed": "加载会话详情失败",
"deleteTitle": "删除会话",
"deleteDesc": "确定删除「{{title}}」?此操作不可恢复。",
"deleted": "已删除",
"deleteFailed": "删除失败",
"label": "历史",
"newBtn": "新建",
"collapseHistory": "收起历史",
"selectK8s": "选择集群和命名空间后查看",
"selectHost": "选择主机后查看",
"noHistory": "暂无历史",
"viewHistory": "查看历史记录",
"rounds": "{{rounds}}轮 · {{tokens}}t",
"statusDone": "完成",
"statusRunning": "进行",
"statusAborted": "中断",
"statusError": "失败"
},
"empty": {
"selectK8s": "请先选择集群和命名空间",
"selectHost": "请先选择一台目标主机",
"connectingK8s": "正在连接集群...",
"connectingHost": "正在连接主机...",
"readyK8s": "描述 Kubernetes 排障任务,例如「查看 NotReady 节点」或「分析 nginx Pod 重启原因」",
"readyHost": "描述你要执行的任务,例如「检查磁盘使用率并清理大文件」",
"currentSafety": "当前安全模式:{{label}}({{short}})",
"noPod": " · 未选 Pod,仅集群/NS 级查询"
},
"input": {
"hint": "Shift+回车换行 · 回车发送",
"stop": "停止",
"execute": "执行"
}
}
},
"breadcrumb": {
"dashboard": "仪表盘",