diff --git a/frontend/src/components/aiops/AIPredictiveAnalytics.tsx b/frontend/src/components/aiops/AIPredictiveAnalytics.tsx
index 68f9175..4fa58ba 100644
--- a/frontend/src/components/aiops/AIPredictiveAnalytics.tsx
+++ b/frontend/src/components/aiops/AIPredictiveAnalytics.tsx
@@ -159,18 +159,18 @@ export function AIPredictiveAnalytics() {
- 关键指标预测
+ {t('aiops.keyMetricForecast')}
- 线性回归预测
+ {t('aiops.linearRegressionForecast')}
{loading ? (
- 加载指标数据...
+ {t('aiops.loadingMetricData')}
) : predictions.length === 0 ? (
{t('aiops.noMetricData')}
@@ -181,15 +181,15 @@ export function AIPredictiveAnalytics() {
{prediction.name.includes('CPU') && }
- {prediction.name.includes('内存') && }
- {prediction.name.includes('磁盘') && }
- {prediction.name.includes('网络') && }
+ {prediction.name.includes(t('aiops.memoryKeyword')) && }
+ {prediction.name.includes(t('aiops.diskKeyword')) && }
+ {prediction.name.includes(t('aiops.networkKeyword')) && }
{prediction.name}
{getTrendIcon(prediction.trend)}
- {prediction.trend === 'up' ? '上升' : prediction.trend === 'down' ? '下降' : '平稳'}
+ {prediction.trend === 'up' ? t('aiops.trendUp') : prediction.trend === 'down' ? t('aiops.trendDown') : t('aiops.trendStable')}
@@ -203,7 +203,7 @@ export function AIPredictiveAnalytics() {
-
预测值 ({prediction.timeRange})
+
{t('aiops.predictedValueLabel', { range: prediction.timeRange })}
{prediction.predicted}
{prediction.unit}
@@ -284,7 +284,7 @@ export function AIPredictiveAnalytics() {
{anomaly.timeframe}
- 概率:{' '}
+ {t('aiops.probabilityColon')}
= 70 ? 'dg-text-red' : 'dg-text-yellow'}>
{anomaly.probability}%
diff --git a/frontend/src/components/aiops/AgentCLI.tsx b/frontend/src/components/aiops/AgentCLI.tsx
index e2b5532..918b371 100644
--- a/frontend/src/components/aiops/AgentCLI.tsx
+++ b/frontend/src/components/aiops/AgentCLI.tsx
@@ -68,7 +68,7 @@ const SAFETY_MODES = [
label: i18n.t('aiops.safetyBalanced'),
short: i18n.t('aiops.safetyHighRiskConfirm'),
desc: i18n.t('aiops.safetyBalancedDesc'),
- examples: 'cat/grep/df 自动 · rm/reboot 确认',
+ examples: i18n.t('aiops.safetyBalancedExamples'),
recommended: true,
},
{
@@ -82,7 +82,7 @@ const SAFETY_MODES = [
// formatServerLabel 主机下拉展示文案 // Logan.Li
function formatServerLabel(s: { hostname: string; ip: string }) {
- return `${s.hostname}(${s.ip})`;
+ return i18n.t('aiops.hostIpFormat', { hostname: s.hostname, ip: s.ip });
}
export default function AgentCLI() {
@@ -291,7 +291,7 @@ export default function AgentCLI() {
}
case 'error':
case 'aborted':
- push({ kind: type === 'aborted' ? 'info' : 'error', content: ev.message || (type === 'aborted' ? '任务已中断' : '发生错误') });
+ push({ kind: type === 'aborted' ? 'info' : 'error', content: ev.message || (type === 'aborted' ? t('aiops.taskAborted') : t('aiops.errorOccurred')) });
setRunning(false);
setCanContinue(type !== 'aborted');
setHistoryRefresh((k) => k + 1);
@@ -303,13 +303,13 @@ export default function AgentCLI() {
const handleConfirm = async (ev: WsEvent) => {
const ok = await confirm({
title: t('aiops.confirmHighRisk'),
- description: `工具:${ev.tool_name}\n风险:${ev.risk}\n命令:${ev.command || t('system.none')}`,
+ description: t('aiops.confirmToolExec', { tool: ev.tool_name, risk: ev.risk, cmd: ev.command || t('system.none') }),
confirmText: t('aiops.assistantConfirmExec'),
cancelText: t('common.deny'),
variant: 'destructive',
});
wsRef.current?.send(JSON.stringify({ type: ok ? 'confirm' : 'deny', confirm_id: ev.confirm_id }));
- if (!ok) push({ kind: 'info', content: `已拒绝执行:${ev.command || ev.tool_name}` });
+ if (!ok) push({ kind: 'info', content: t('aiops.rejectedExec', { cmd: ev.command || ev.tool_name }) });
};
// 发送任务 // Logan.Li
@@ -342,7 +342,7 @@ export default function AgentCLI() {
setItems([
{
id: nextId(), kind: 'info',
- content: `查看历史记录:${sess.title}(${sess.status === 'done' ? '已完成' : sess.status})— 仅浏览,点击「继续追问」可在此基础上接着执行`,
+ content: t('aiops.viewHistoryDetail', { title: sess.title, status: sess.status === 'done' ? t('aiops.taskDone') : sess.status }),
},
...replayItems,
]);
@@ -357,7 +357,7 @@ export default function AgentCLI() {
return;
}
wsRef.current.send(JSON.stringify({ type: 'resume', session_id: viewSession.id }));
- push({ kind: 'info', content: `正在恢复会话「${viewSession.title}」…` });
+ push({ kind: 'info', content: t('aiops.resumingSession', { title: viewSession.title }) });
};
const handleNewTask = () => {
@@ -439,7 +439,7 @@ export default function AgentCLI() {
)}
{m.desc}
-
例:{m.examples}
+
{t('aiops.examplePrefix')}{m.examples}
))}
@@ -454,7 +454,7 @@ export default function AgentCLI() {
title={historyOpen ? t('aiops.collapseHistory') : t('aiops.expandHistory')}
>
{historyOpen ?