refactor(i18n): U39 残余 JSX 属性/模板字面量中文清零 — 14 处→0

10 文件修复:
- DualLineChart: subtitle 接收/发送→i18n.t(monitor.lbl.receiveSend)
- NetworkTab: 5处 unit="个"→t(common.unitCount)
- FDUsageCard: subtitle 当前→t(monitor.lbl.currentFDUsage)
- NamespaceOverviewPage: subtitle 命名空间概览→i18n.t(k8s.nsOverview.subtitle)
- NamespaceManagementPage: subtitle 资源配额→i18n.t(k8s.nsMgmt.quotaSubtitle)
- CreateHPADialog: title+text 命名空间→i18n.t(k8s.hpa.targetInfo)
- LogFieldSidebar: title 个值→i18n.t(common.fieldValues)
- LiveMonitorDialog: title 全屏/退出全屏→t(common.fullscreen/exitFullscreen)
- ExecutionHistoryDialog: title 成功/失败→t(task.execHistory.successFail)
- LdapSettingsTab: className 成功检查→ldapTestSuccess boolean 状态

新增 11 翻译键 (common.unitCount/fieldValues/exitFullscreen/fullscreen +
monitor.lbl.receiveSend/currentFDUsage + k8s.nsOverview.subtitle/nsMgmt.quotaSubtitle/hpa.targetInfo +
task.execHistory.successFail), zh/en 7751→7762 对齐

tsc -b=0, npm build✓ (16.94s), ESLint=0/0/any=0, go build=0, 17/17 测试通过
This commit is contained in:
attacker committed 2026-07-13 13:12:54 +08:00
1 parent a1d82574a7
commit 5205def47f
14 files changed
+67 -29

No files matched your search

@@ -232,7 +232,7 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
type="button"
onClick={() => setFullscreen(!fullscreen)}
className="p-1.5 rounded hover:bg-[var(--dg-bg-hover)] text-[var(--dg-text-secondary)]"
title={fullscreen ? '退出全屏' : '全屏'}
title={fullscreen ? t('common.exitFullscreen') : t('common.fullscreen')}
>
{fullscreen ? <Minimize2 className="h-4 w-4" /> : <Maximize2 className="h-4 w-4" />}
</button>
@@ -57,6 +57,7 @@ export interface SystemSettingsTabProps {
ldapSaving: boolean;
ldapTesting: boolean;
ldapTestResult: string | null;
ldapTestSuccess: boolean;
handleLdapSave: () => void;
handleLdapTest: () => void;
// LDAP management - pass-through to LdapManagementSection
@@ -17,6 +17,7 @@ type LdapSettingsTabProps = Pick<
| "ldapSaving"
| "ldapTesting"
| "ldapTestResult"
| "ldapTestSuccess"
| "handleLdapSave"
| "handleLdapTest"
> &
@@ -75,6 +76,7 @@ export function LdapSettingsTab(props: LdapSettingsTabProps) {
ldapSaving,
ldapTesting,
ldapTestResult,
ldapTestSuccess,
handleLdapSave,
handleLdapTest,
} = props;
@@ -204,7 +206,7 @@ export function LdapSettingsTab(props: LdapSettingsTabProps) {
<div className="flex items-center gap-3 mt-4 pt-4 border-t border-[var(--dg-border)]">
{ldapTestResult && (
<span
className={`text-xs ${ldapTestResult.includes("成功") ? "dg-text-green" : "dg-text-red"}`}
className={`text-xs ${ldapTestSuccess ? "dg-text-green" : "dg-text-red"}`}
>
{ldapTestResult}
</span>
@@ -38,6 +38,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
const [ldapSaving, setLdapSaving] = useState(false);
const [ldapTesting, setLdapTesting] = useState(false);
const [ldapTestResult, setLdapTestResult] = useState<string | null>(null);
const [ldapTestSuccess, setLdapTestSuccess] = useState(false);
const [ldapMgmtOpen, setLdapMgmtOpen] = useState(false);
const [importFeedback, setImportFeedback] = useState<string | null>(null);
const [importResultOpen, setImportResultOpen] = useState(false);
@@ -101,11 +102,14 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
const handleLdapTest = async () => {
setLdapTesting(true);
setLdapTestResult(null);
setLdapTestSuccess(false);
try {
await ldapApi.updateConfig(ldapForm);
const res = await ldapApi.testConnection();
setLdapTestSuccess(!!res?.success);
setLdapTestResult(res?.message || (res?.success ? i18n.t('aiops.llmTestSuccess') : i18n.t('aiops.llmTestFailed')));
} catch (error) {
setLdapTestSuccess(false);
setLdapTestResult(error?.message || i18n.t('aiops.llmTestFailed'));
} finally {
setLdapTesting(false);
@@ -293,6 +297,7 @@ export function useLdapManagement(onUsersChanged: () => Promise<void> | void) {
ldapSaving,
ldapTesting,
ldapTestResult,
ldapTestSuccess,
handleLdapSave,
handleLdapTest,
ldapMgmtOpen,