fix(aiops): 菜单移至日志告警下系统设置上;模型配置精简
- 菜单顺序:日志查询 → 日志分析 → 日志告警 → 智能运维 → 系统设置 - 模型配置去掉快捷预设按钮组;Base URL 仅选「自定义」供应商时显示; 温度/输出上限/超时/每日token上限/额外脱敏收进「高级设置」折叠(默认收起), 常规配置只剩:供应商下拉 + 模型名 + API Key + 测试/保存
This commit is contained in:
1 parent
9641503007
commit
07aa41bc33
4 files changed
+10
-35
No files matched your search
@@ -58,9 +58,7 @@ export default {
|
||||
},
|
||||
|
||||
config: {
|
||||
quickPresets: 'Quick presets',
|
||||
presetCustom: 'Custom',
|
||||
presetHint: 'DeepSeek official picks; custom accepts any OpenAI-compatible endpoint',
|
||||
advanced: 'Advanced',
|
||||
providerSelectHint: 'Pick a provider to autofill endpoint and model',
|
||||
enabled: 'Enable AI analysis',
|
||||
enabledHint: 'When off, Analyze returns a clear "not enabled" message',
|
||||
|
||||
@@ -58,9 +58,7 @@ export default {
|
||||
},
|
||||
|
||||
config: {
|
||||
quickPresets: '快捷预设',
|
||||
presetCustom: '自定义',
|
||||
presetHint: 'DeepSeek 官方推荐;自定义可手填任意 OpenAI 兼容端点',
|
||||
advanced: '高级设置',
|
||||
providerSelectHint: '选择供应商自动填入端点与推荐模型',
|
||||
enabled: '启用 AI 分析',
|
||||
enabledHint: '关闭后「开始分析」会直接提示未启用,不影响其它功能',
|
||||
|
||||
@@ -518,34 +518,6 @@ export default function AiopsPage() {
|
||||
</span>
|
||||
</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="space-y-1">
|
||||
<Label className="text-xs">{t('config.provider')}</Label>
|
||||
@@ -581,6 +553,7 @@ export default function AiopsPage() {
|
||||
</datalist>
|
||||
<p className="text-[11px] text-muted-foreground">{t('config.modelHint')}</p>
|
||||
</div>
|
||||
{matchProvider(config.baseUrl) === 'custom' && (
|
||||
<div className="space-y-1 sm:col-span-2">
|
||||
<Label className="text-xs">{t('config.baseUrl')}</Label>
|
||||
<Input
|
||||
@@ -590,6 +563,7 @@ export default function AiopsPage() {
|
||||
/>
|
||||
<p className="text-[11px] text-muted-foreground">{t('config.baseUrlHint')}</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="space-y-1">
|
||||
<Label className="text-xs">{t('config.apiKey')}</Label>
|
||||
<Input
|
||||
@@ -600,6 +574,9 @@ export default function AiopsPage() {
|
||||
/>
|
||||
<p className="text-[11px] text-muted-foreground">{t('config.apiKeyHint')}</p>
|
||||
</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="space-y-1">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
{/* 顺序按实际操作流:先「测试连接」确认能通,再「保存配置」 */}
|
||||
|
||||
@@ -73,7 +73,7 @@ export const routes: AppRoute[] = [
|
||||
{ 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 } },
|
||||
// 智能运维: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 } },
|
||||
|
||||
// ── 告警:独立入口(要盯的,不能被折叠) ──
|
||||
// 告警仅管理员:普通用户按「查询授权」只看指定的日志(菜单只剩日志查询)。
|
||||
|
||||
Reference in new issue
Block a user