refactor(settings): AI 模型接入拆为独立 tab 页(/settings/ai)
CI / Backend (go vet + test) (push) Waiting to run
CI / Frontend (lint + build + test) (push) Waiting to run

系统设置分组 tab 顺序:通用配置 → 用户管理 → 审计日志 → LDAP 接入 →
AI 模型接入 → 默认镜像源;设置主页去掉内嵌卡片,子页复用 AiModelSection
This commit is contained in:
opsx committed 2026-11-01 01:38:43 +08:00
1 parent 6923a12dd9
commit 37a610b603
5 files changed
+22 -3

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ export default {
analysis: 'Log analysis', analysis: 'Log analysis',
settings: 'General', settings: 'General',
ldap: 'LDAP', ldap: 'LDAP',
aiModel: 'AI Model',
registry: 'Image Registry', registry: 'Image Registry',
users: 'Users', users: 'Users',
audit: 'Audit Log', audit: 'Audit Log',
+1
View File
@@ -19,6 +19,7 @@ export default {
analysis: '日志分析', analysis: '日志分析',
settings: '通用配置', settings: '通用配置',
ldap: 'LDAP 接入', ldap: 'LDAP 接入',
aiModel: 'AI 模型接入',
registry: '默认镜像源', registry: '默认镜像源',
users: '用户管理', users: '用户管理',
audit: '审计日志', audit: '审计日志',
+16
View File
@@ -0,0 +1,16 @@
import { memo } from 'react'
import { useTranslation } from 'react-i18next'
import { PageContainer } from '@/components/PageContainer'
import { AiModelSection } from './components/AiModelSection'
/** AI 模型接入:系统设置分组的一个 tab(原设置页通用配置内的卡片拆出) */
const AiModelPage = memo(function AiModelPage() {
const { t } = useTranslation('aiops')
return (
<PageContainer title={t('config.sectionTitle')}>
<AiModelSection />
</PageContainer>
)
})
export default AiModelPage
-2
View File
@@ -13,7 +13,6 @@ import { PageContainer } from '@/components/PageContainer'
import { ThemeSection } from './components/ThemeSection' import { ThemeSection } from './components/ThemeSection'
import { RetentionSection } from './components/RetentionSection' import { RetentionSection } from './components/RetentionSection'
import { LicenseSection } from './components/LicenseSection' import { LicenseSection } from './components/LicenseSection'
import { AiModelSection } from './components/AiModelSection'
import { LanguageSection } from '@/i18n/LanguageSection' import { LanguageSection } from '@/i18n/LanguageSection'
import { Palette } from 'lucide-react' import { Palette } from 'lucide-react'
@@ -72,7 +71,6 @@ const SettingsPage = memo(function SettingsPage() {
return ( return (
<PageContainer title={t('title')}> <PageContainer title={t('title')}>
<LicenseSection /> <LicenseSection />
<AiModelSection />
{/* 不再有内层 tab:LDAP / 镜像源 已拆成独立路由, {/* 不再有内层 tab:LDAP / 镜像源 已拆成独立路由,
由左侧「系统设置」分组的顶层 tab 切换(单层 tab 更好理解)。 */} 由左侧「系统设置」分组的顶层 tab 切换(单层 tab 更好理解)。 */}
<div className="space-y-6"> <div className="space-y-6">
+4 -1
View File
@@ -19,6 +19,7 @@ import {
Boxes, Boxes,
ShieldCheck, ShieldCheck,
Container, Container,
Bot,
} from 'lucide-react'; } from 'lucide-react';
import type { AppRoute, MenuItem, RouteMeta } from '@/types/router'; import type { AppRoute, MenuItem, RouteMeta } from '@/types/router';
@@ -32,6 +33,7 @@ const Collectors = lazy(() => import('@/pages/collectors'));
const SettingsPage = lazy(() => import('@/pages/settings')); const SettingsPage = lazy(() => import('@/pages/settings'));
const LdapPage = lazy(() => import('@/pages/settings/ldap')); const LdapPage = lazy(() => import('@/pages/settings/ldap'));
const RegistryPage = lazy(() => import('@/pages/settings/registry')); const RegistryPage = lazy(() => import('@/pages/settings/registry'));
const AiModelPage = lazy(() => import('@/pages/settings/ai'));
const NotFound = lazy(() => import('@/pages/not-found')); const NotFound = lazy(() => import('@/pages/not-found'));
const WizardPage = lazy(() => import('@/pages/wizard')); const WizardPage = lazy(() => import('@/pages/wizard'));
const LogsPage = lazy(() => import('@/pages/logs')); const LogsPage = lazy(() => import('@/pages/logs'));
@@ -88,7 +90,8 @@ export const routes: AppRoute[] = [
}, },
{ path: '/audit', component: AuditPage, auth: true, meta: { title: 'menu.audit', icon: History, order: 10, adminOnly: true, groupKey: 'system', proOnly: true } }, { path: '/audit', component: AuditPage, auth: true, meta: { title: 'menu.audit', icon: History, order: 10, adminOnly: true, groupKey: 'system', proOnly: true } },
{ path: '/settings/ldap', component: LdapPage, auth: true, meta: { title: 'menu.ldap', icon: ShieldCheck, order: 11, adminOnly: true, groupKey: 'system' } }, { path: '/settings/ldap', component: LdapPage, auth: true, meta: { title: 'menu.ldap', icon: ShieldCheck, order: 11, adminOnly: true, groupKey: 'system' } },
{ path: '/settings/registry', component: RegistryPage, auth: true, meta: { title: 'menu.registry', icon: Container, order: 12, adminOnly: true, groupKey: 'system' } }, { path: '/settings/registry', component: RegistryPage, auth: true, meta: { title: 'menu.registry', icon: Container, order: 13, adminOnly: true, groupKey: 'system' } },
{ path: '/settings/ai', component: AiModelPage, auth: true, meta: { title: 'menu.aiModel', icon: Bot, order: 12, adminOnly: true, groupKey: 'system' } },
// 系统设置放回侧栏,并作为「系统设置」分组的 tab 起点(order 最小 = 排在第一个) // 系统设置放回侧栏,并作为「系统设置」分组的 tab 起点(order 最小 = 排在第一个)
{ {
path: '/settings', component: SettingsPage, auth: true, path: '/settings', component: SettingsPage, auth: true,