refactor(i18n): U41 残余硬编码中文清零 — 工具函数+审计RDP标签+AIOps分析+Monitor残余+审批选项
18 文件 ~35 处 UI 硬编码中文→t()/i18n.t() 调用: - agent-utils.ts timeAgo() 秒前/分钟前/小时前 - utils.ts formatDistanceToNow() 分钟前/小时前/天前 - request.ts 响应解析失败错误消息 - ActiveSessionsPanel/HistorySessionsPanel RDP 在线/历史会话标签 - MetricsExplorer 清除/已选/最近1小时 - HostMonitor 当前主机 subtitle - AIAnalysisResult 证据链 (新增 useTranslation hook) - capacity-predict.ts 容量预测摘要模板 - ApprovalResourcePage 阿里云/腾讯云/华为云 - ApprovalPermissionPage 堡垒机 - site-monitor/helpers.ts 频率/时间/证书天数格式化 - site-monitor/analytics.ts 证书剩余/检查失败/延迟波动事件 - middleware-monitor MwTargetChartsPanel/MwTrendChart/helpers.ts - snmp-monitor SnmpMetricTrendChart/SnmpDeviceChartsPanel - host-monitor/utils.ts 图表点数标签 + PortPolicyDialog 系统进程说明 新增 34 翻译键 (common.duration.secAgo/hourAgo/dayAgo + common.selected/ responseParseError/rdpActiveSessions/rdpHistorySessions/rdpSessionCount/ evidenceChain/last1Hour/currentHost + monitor.lbl 10键 + monitor.siteMonitor 8键 + approval.provider 3键 + approval.permType 1键 + monitor.portPolicyDialog.systemProcessDesc + aiops.capacity.summary) zh/en 7813→7847 对齐; tsc -b=0, npm build✓ (17.31s), ESLint=0/43/any=0, go build=0, 17/17 测试通过
This commit is contained in:
1 parent
4e2ba77aa8
commit
a7838aaf65
23 files changed
+140
-57
No files matched your search
@@ -4,6 +4,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { Sparkles, Brain, Loader2 } from 'lucide-react';
|
||||
import { AlertCircle, TrendingUp, CheckCircle, FileText, Terminal, Play } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { AlertItem, AIAnalysis } from './analyzerHelpers';
|
||||
import i18n from '@/i18n';
|
||||
|
||||
@@ -15,6 +16,7 @@ interface AIAnalysisResultProps {
|
||||
}
|
||||
|
||||
export function AIAnalysisResult({ selectedAlert, isAnalyzing, analysis, onAutoFix }: AIAnalysisResultProps) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Card className="dg-card flex flex-col">
|
||||
<CardHeader className="border-b border-[var(--dg-border)] pb-3">
|
||||
@@ -91,7 +93,7 @@ export function AIAnalysisResult({ selectedAlert, isAnalyzing, analysis, onAutoF
|
||||
<div className="space-y-2">
|
||||
<h4 className="text-sm font-medium text-[var(--dg-text-secondary)] flex items-center gap-2">
|
||||
<FileText className="h-4 w-4 dg-text-blue" />
|
||||
证据链
|
||||
{t('common.evidenceChain')}
|
||||
</h4>
|
||||
<div className="space-y-2">
|
||||
{analysis.evidence.slice(0, 5).map((item, idx) => (
|
||||
|
||||
@@ -178,7 +178,7 @@ export function buildCapacityInsightPrompt(forecasts: CapacityForecast[]): strin
|
||||
if (forecasts.length === 0) return '';
|
||||
const lines = forecasts.map((f) => {
|
||||
const risk = f.daysUntilThreshold >= 999 ? i18n.t('aiops.capacity.noRisk') : i18n.t('aiops.predictutilsts.daysUntilThreshold', { days: f.daysUntilThreshold });
|
||||
return `- ${f.resource}:当前 ${f.currentUsage}% → 7天后预测 ${f.predictedUsage}%(阈值 ${f.threshold}%),${risk}`;
|
||||
return i18n.t('aiops.capacity.summary', { resource: f.resource, current: f.currentUsage, predicted: f.predictedUsage, threshold: f.threshold, risk });
|
||||
});
|
||||
return [
|
||||
i18n.t('aiops.capacity.expertPrompt'),
|
||||
|
||||
Reference in new issue
Block a user