fix(i18n): U18 幻影 i18n hash 键治理 — 从 git 历史恢复 1540/1696 处原始中文文本 (91%)
问题: i18n 批量转换 (commit55f216c) 生成了 813 个 hash 键引用但翻译从未写入 JSON, 导致用户在受影响模块看到 hash 键路径(如 monitor.quickquerybarts.s64559524)而非实际文本. 影响范围: 126 个文件、1696 处引用、monitor/kubernetes/aiops/pipeline/task/agent/cloud 11 个命名空间. 修复策略: 用 git 历史中 pre-i18n 版本(commit7e1c8f5)的原始中文文本, 通过结构相似度匹配(difflib SequenceMatcher)将 hash 键引用替换为实际字符串. 对于组件拆分后产生的新文件,映射到其原始源文件查找中文文本. 修复明细: - monitor 命名空间: 335 键修复(站点拨测/日志中心/中间件监控/告警规则/SNMP/主机监控) - kubernetes 命名空间: 195 键修复(资源编辑器/Deployment编辑器/事件/命名空间/Pod日志) - aiops 命名空间: 70 键修复(容量预测/成本预测/告警分析) - pipeline/task/agent/cloud/common 命名空间: 其余键修复 验证: tsc -b=0, npm build✓ (16.87s), ESLint=0/0/0, go build=0, 17/17 测试通过, Docker healthy
This commit is contained in:
1 parent
be1011eb58
commit
4c4aaf60f6
100 files changed
+688
-688
No files matched your search
@@ -23,7 +23,7 @@ function escapeCsv(s: string): string {
|
||||
// exportAuditReportCsv 导出会话审计报告 CSV // Logan.Li
|
||||
export function exportAuditReportCsv(meta: ReplaySessionMeta, commands: CommandBookmark[]) {
|
||||
const lines: string[] = [
|
||||
i18n.t('system.exportauditts.s3cb7eb59'),
|
||||
i18n.t('# 终端会话审计报告'),
|
||||
`会话ID,${meta.id}`,
|
||||
`用户,${escapeCsv(meta.username || '')}`,
|
||||
`目标主机,${escapeCsv(meta.server_name || '')}`,
|
||||
@@ -33,7 +33,7 @@ export function exportAuditReportCsv(meta: ReplaySessionMeta, commands: CommandB
|
||||
`时长(秒),${meta.duration || 0}`,
|
||||
`录制大小,${meta.record_size || 0}`,
|
||||
'',
|
||||
i18n.t('system.exportauditts.s7a85eed7'),
|
||||
i18n.t('# 终端会话审计报告'),
|
||||
];
|
||||
for (const c of commands) {
|
||||
lines.push(`${c.label},${escapeCsv(c.command)},${c.highRisk ? '是' : '否'}`);
|
||||
@@ -55,7 +55,7 @@ export interface CommandExportRow {
|
||||
|
||||
// exportCommandsListCsv 导出命令列表 CSV // Logan.Li
|
||||
export function exportCommandsListCsv(commands: CommandExportRow[]) {
|
||||
const lines: string[] = [i18n.t('system.exportauditts.s6e047305')];
|
||||
const lines: string[] = [i18n.t('时间,用户,命令,输出大小,会话ID,高危')];
|
||||
for (const c of commands) {
|
||||
const ts = c.timestamp || c.created_at || '';
|
||||
const highRisk = isHighRiskCommand(c.command || '');
|
||||
|
||||
@@ -148,7 +148,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
|
||||
if (msg.includes('Already Exists') || msg.includes('68')) {
|
||||
toast.error(i18n.t('system.useldapmanageme.s1a2b3c4d', { name: ouForm.ou_name }));
|
||||
} else {
|
||||
toast.error(i18n.t('system.useldapmanageme.s2b3c4d5e') + msg);
|
||||
toast.error(i18n.t('创建失败: ') + msg);
|
||||
}
|
||||
} finally { setLdapSaving(false); }
|
||||
};
|
||||
@@ -168,7 +168,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
|
||||
/** 删除 LDAP 条目 // Logan.Li */
|
||||
const handleDeleteLDAPEntry = async (dn: string, silent = false) => {
|
||||
if (!silent) {
|
||||
const ok = await confirm({ title: i18n.t('system.useldapmanageme.s9724378b'), description: `确定删除 ${dn}?`, confirmText: i18n.t('kubernetes.storage.delete2'), variant: 'destructive' });
|
||||
const ok = await confirm({ title: i18n.t('删除 LDAP 条目'), description: `确定删除 ${dn}?`, confirmText: i18n.t('kubernetes.storage.delete2'), variant: 'destructive' });
|
||||
if (!ok) return;
|
||||
}
|
||||
try {
|
||||
@@ -190,7 +190,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
|
||||
await ldapApi.updateUser({ dn: editLdapUser.dn, ...editLdapForm });
|
||||
setEditLdapUser(null);
|
||||
await loadLdapOUUsers(selectedOUDN);
|
||||
} catch (e) { toast.error(e?.message || i18n.t('common.profilepagetsx.s5badb3ba')); }
|
||||
} catch (e) { toast.error(e?.message || i18n.t('修改失败')); }
|
||||
};
|
||||
|
||||
/** LDAP 账号验证测试 // Logan.Li */
|
||||
@@ -201,7 +201,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
|
||||
const res = await ldapApi.testConnection({ test_user: ldapTestUser, test_password: ldapTestPass });
|
||||
setLdapUserTestResult(res);
|
||||
} catch (e) {
|
||||
setLdapUserTestResult({ success: false, message: e?.message || i18n.t('system.useldapmanageme.se441b11e') });
|
||||
setLdapUserTestResult({ success: false, message: e?.message || i18n.t('验证失败') });
|
||||
} finally { setLdapUserTesting(false); }
|
||||
};
|
||||
|
||||
@@ -234,11 +234,11 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
|
||||
} else if (opts?.importAll) {
|
||||
selected = ldapUsers;
|
||||
} else {
|
||||
toast.error(i18n.t('system.useldapmanageme.sa8ca9651'));
|
||||
toast.error(i18n.t('请至少选择一个用户'));
|
||||
return;
|
||||
}
|
||||
if (selected.length === 0) {
|
||||
toast.error(i18n.t('system.useldapmanageme.sd196a1c0'));
|
||||
toast.error(i18n.t('请至少选择一个用户'));
|
||||
return;
|
||||
}
|
||||
setImporting(true);
|
||||
@@ -265,7 +265,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
|
||||
await onUsersChanged();
|
||||
} catch (error: unknown) {
|
||||
const errMsg = error instanceof Error ? error.message : i18n.t('monitor.dashboard.agent.toast.unknownError');
|
||||
const result = { code: 500, message: i18n.t('system.useldapmanageme.s45332d13') + errMsg };
|
||||
const result = { code: 500, message: i18n.t('导入失败: ') + errMsg };
|
||||
if (opts?.setResult) {
|
||||
opts.setResult(result);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user