diff --git a/frontend/src/i18n/locales/en/aiops.ts b/frontend/src/i18n/locales/en/aiops.ts index 38ae7ea..59b86b0 100644 --- a/frontend/src/i18n/locales/en/aiops.ts +++ b/frontend/src/i18n/locales/en/aiops.ts @@ -20,6 +20,7 @@ export default { }, analyze: { + goConfig: 'Open config', appScope: 'App scope', allApps: 'All apps', appRequired: 'Required (over 1h)', diff --git a/frontend/src/i18n/locales/zh/aiops.ts b/frontend/src/i18n/locales/zh/aiops.ts index 349c76e..8129aa2 100644 --- a/frontend/src/i18n/locales/zh/aiops.ts +++ b/frontend/src/i18n/locales/zh/aiops.ts @@ -20,6 +20,7 @@ export default { }, analyze: { + goConfig: '去配置', appScope: '应用范围', allApps: '全部应用', appRequired: '必选(超过 1 小时)', diff --git a/frontend/src/pages/aiops/index.tsx b/frontend/src/pages/aiops/index.tsx index 8316bc4..02e579c 100644 --- a/frontend/src/pages/aiops/index.tsx +++ b/frontend/src/pages/aiops/index.tsx @@ -190,6 +190,7 @@ export default function AiopsPage() { .filter(Boolean), }) setConfig(res.config) + setEnabled(Boolean(res.config?.enabled)) setApiKeyInput('') toast.success('配置已保存') } catch (err) { @@ -245,13 +246,16 @@ export default function AiopsPage() { {/* ─────────── 分析 ─────────── */} {!enabled && ( -
- {t('analyze.notEnabled')} +
+ + {t('analyze.notEnabled')} +
)} - + +
setQuestion(e.target.value)} - className="h-9" - /> +
+ + setQuestion(e.target.value)} + className="h-9" + /> +
+
+
+

{t('analyze.runHint')}

+
- -
{t('analyze.runHint')}
{!outcome && !running && ( - {t('analyze.empty')} + + +

{t('analyze.empty')}

+
)} {running && ( - - - {t('analyze.running')} + + +

{t('analyze.running')}

+

{t('analyze.runHint')}

)} @@ -334,13 +345,12 @@ export default function AiopsPage() { {outcome && ( <> {/* 本次消耗:让成本和延迟是可见的 */} -
- - {t('analyze.lastRun')}:{t('analyze.promptTokens')} {fmtNum(outcome.run.promptTokens)} ·{' '} - {t('analyze.completionTokens')} {fmtNum(outcome.run.completionTokens)} · {t('analyze.duration')}{' '} - {(outcome.run.durationMs / 1000).toFixed(1)}s - -