fix(aiops): 菜单移至日志告警下系统设置上;模型配置精简
CI / Backend (go vet + test) (push) Waiting to run
CI / Frontend (lint + build + test) (push) Waiting to run

- 菜单顺序:日志查询 → 日志分析 → 日志告警 → 智能运维 → 系统设置
- 模型配置去掉快捷预设按钮组;Base URL 仅选「自定义」供应商时显示;
  温度/输出上限/超时/每日token上限/额外脱敏收进「高级设置」折叠(默认收起),
  常规配置只剩:供应商下拉 + 模型名 + API Key + 测试/保存
This commit is contained in:
opsx committed 2026-10-31 23:36:16 +08:00
1 parent 9641503007
commit 07aa41bc33
4 files changed
+10 -35

No files matched your search

+1 -3
View File
@@ -58,9 +58,7 @@ export default {
}, },
config: { config: {
quickPresets: 'Quick presets', advanced: 'Advanced',
presetCustom: 'Custom',
presetHint: 'DeepSeek official picks; custom accepts any OpenAI-compatible endpoint',
providerSelectHint: 'Pick a provider to autofill endpoint and model', providerSelectHint: 'Pick a provider to autofill endpoint and model',
enabled: 'Enable AI analysis', enabled: 'Enable AI analysis',
enabledHint: 'When off, Analyze returns a clear "not enabled" message', enabledHint: 'When off, Analyze returns a clear "not enabled" message',
+1 -3
View File
@@ -58,9 +58,7 @@ export default {
}, },
config: { config: {
quickPresets: '快捷预设', advanced: '高级设置',
presetCustom: '自定义',
presetHint: 'DeepSeek 官方推荐;自定义可手填任意 OpenAI 兼容端点',
providerSelectHint: '选择供应商自动填入端点与推荐模型', providerSelectHint: '选择供应商自动填入端点与推荐模型',
enabled: '启用 AI 分析', enabled: '启用 AI 分析',
enabledHint: '关闭后「开始分析」会直接提示未启用,不影响其它功能', enabledHint: '关闭后「开始分析」会直接提示未启用,不影响其它功能',
+7 -28
View File
@@ -518,34 +518,6 @@ export default function AiopsPage() {
</span> </span>
</div> </div>
<div className="flex flex-wrap items-end gap-2">
<div className="space-y-1">
<Label className="text-xs">{t('config.quickPresets')}</Label>
<div className="flex gap-2">
{LLM_PROVIDERS.filter(p => p.id === 'deepseek')[0].models.slice(0, 2).reverse().concat([]).map(m => (
<Button
key={m}
type="button"
size="sm"
variant={config.model === m ? 'default' : 'outline'}
onClick={() => setConfig({ ...config, baseUrl: LLM_PROVIDERS.find(p => p.id === 'deepseek')!.endpoint, model: m })}
>
{m}
</Button>
))}
<Button
type="button"
size="sm"
variant={matchProvider(config.baseUrl) === 'custom' ? 'default' : 'outline'}
onClick={() => setConfig({ ...config, baseUrl: '', model: '' })}
>
{t('config.presetCustom')}
</Button>
</div>
<p className="text-[11px] text-muted-foreground">{t('config.presetHint')}</p>
</div>
</div>
<div className="grid gap-4 sm:grid-cols-2"> <div className="grid gap-4 sm:grid-cols-2">
<div className="space-y-1"> <div className="space-y-1">
<Label className="text-xs">{t('config.provider')}</Label> <Label className="text-xs">{t('config.provider')}</Label>
@@ -581,6 +553,7 @@ export default function AiopsPage() {
</datalist> </datalist>
<p className="text-[11px] text-muted-foreground">{t('config.modelHint')}</p> <p className="text-[11px] text-muted-foreground">{t('config.modelHint')}</p>
</div> </div>
{matchProvider(config.baseUrl) === 'custom' && (
<div className="space-y-1 sm:col-span-2"> <div className="space-y-1 sm:col-span-2">
<Label className="text-xs">{t('config.baseUrl')}</Label> <Label className="text-xs">{t('config.baseUrl')}</Label>
<Input <Input
@@ -590,6 +563,7 @@ export default function AiopsPage() {
/> />
<p className="text-[11px] text-muted-foreground">{t('config.baseUrlHint')}</p> <p className="text-[11px] text-muted-foreground">{t('config.baseUrlHint')}</p>
</div> </div>
)}
<div className="space-y-1"> <div className="space-y-1">
<Label className="text-xs">{t('config.apiKey')}</Label> <Label className="text-xs">{t('config.apiKey')}</Label>
<Input <Input
@@ -600,6 +574,9 @@ export default function AiopsPage() {
/> />
<p className="text-[11px] text-muted-foreground">{t('config.apiKeyHint')}</p> <p className="text-[11px] text-muted-foreground">{t('config.apiKeyHint')}</p>
</div> </div>
<details className="sm:col-span-2 rounded-lg border px-3 py-2">
<summary className="cursor-pointer text-xs font-medium text-muted-foreground">{t('config.advanced')}</summary>
<div className="mt-3 grid gap-4">
<div className="grid grid-cols-3 gap-2"> <div className="grid grid-cols-3 gap-2">
<div className="space-y-1"> <div className="space-y-1">
<Label className="text-xs">{t('config.temperature')}</Label> <Label className="text-xs">{t('config.temperature')}</Label>
@@ -648,6 +625,8 @@ export default function AiopsPage() {
/> />
<p className="text-[11px] text-muted-foreground">{t('config.redactExtraHint')}</p> <p className="text-[11px] text-muted-foreground">{t('config.redactExtraHint')}</p>
</div> </div>
</div>
</details>
</div> </div>
{/* 顺序按实际操作流:先「测试连接」确认能通,再「保存配置」 */} {/* 顺序按实际操作流:先「测试连接」确认能通,再「保存配置」 */}
+1 -1
View File
@@ -73,7 +73,7 @@ export const routes: AppRoute[] = [
{ path: '/logs', component: LogsPage, auth: true, meta: { title: 'menu.logs', icon: ScrollText, order: 5 } }, { path: '/logs', component: LogsPage, auth: true, meta: { title: 'menu.logs', icon: ScrollText, order: 5 } },
{ path: '/analysis', component: AnalysisPage, auth: true, meta: { title: 'menu.analysis', icon: BarChart3, order: 6, adminOnly: true, proOnly: true } }, { path: '/analysis', component: AnalysisPage, auth: true, meta: { title: 'menu.analysis', icon: BarChart3, order: 6, adminOnly: true, proOnly: true } },
// 智能运维:AI 日志分析。紧跟日志分析,便于"先看统计、再问 AI"的动线 // 智能运维:AI 日志分析。紧跟日志分析,便于"先看统计、再问 AI"的动线
{ path: '/aiops', component: AiopsPage, auth: true, meta: { title: 'menu.aiops', icon: Sparkles, order: 6, adminOnly: true, proOnly: true } }, { path: '/aiops', component: AiopsPage, auth: true, meta: { title: 'menu.aiops', icon: Sparkles, order: 7.5, adminOnly: true, proOnly: true } },
// ── 告警:独立入口(要盯的,不能被折叠) ── // ── 告警:独立入口(要盯的,不能被折叠) ──
// 告警仅管理员:普通用户按「查询授权」只看指定的日志(菜单只剩日志查询)。 // 告警仅管理员:普通用户按「查询授权」只看指定的日志(菜单只剩日志查询)。