feat(web): 优化页面跳转和菜单展现

This commit is contained in:
v-zhangjc9
2025-05-12 15:59:46 +08:00
parent 1e7b195f9f
commit b0603d10bc
19 changed files with 336 additions and 209 deletions

View File

@@ -4,17 +4,19 @@ import {
ClusterOutlined,
CompressOutlined,
InfoCircleOutlined,
OpenAIOutlined,
QuestionOutlined,
SunOutlined,
SyncOutlined,
TableOutlined,
ToolOutlined,
} from '@ant-design/icons'
import type {Route} from '@ant-design/pro-layout/es/typing'
import type {RouteObject} from 'react-router'
import Ai from './pages/Ai.tsx'
import {Navigate, type RouteObject} from 'react-router'
import Conversation from './pages/ai/Conversation.tsx'
import Inspection from './pages/ai/Inspection.tsx'
import App from './pages/App.tsx'
import Cloud from './pages/overview/Cloud.tsx'
import Overview from './pages/Overview.tsx'
import Overview from './pages/overview/Overview.tsx'
import Queue from './pages/overview/Queue.tsx'
import Table from './pages/overview/Table.tsx'
import Task from './pages/overview/Task.tsx'
@@ -30,54 +32,67 @@ export const routes: RouteObject[] = [
Component: App,
children: [
{
children: [
{
index: true,
Component: Overview,
},
{
path: 'table',
Component: Table,
},
{
path: 'queue',
Component: Queue,
},
{
path: 'version',
Component: Version,
},
{
path: 'yarn/:clusters/:queue/:search?',
Component: Yarn,
},
{
path: 'cloud',
Component: Cloud,
},
{
path: 'yarn_cluster',
Component: YarnCluster,
},
{
path: 'tool',
Component: Tool,
},
{
path: 'task',
Component: Task,
},
],
index: true,
element: <Navigate to="/overview" replace/>,
},
{
path: 'overview',
Component: Overview,
},
{
path: 'table',
Component: Table,
},
{
path: 'queue',
Component: Queue,
},
{
path: 'version',
Component: Version,
},
{
path: 'yarn/:clusters/:queue/:search?',
Component: Yarn,
},
{
path: 'cloud',
Component: Cloud,
},
{
path: 'yarn_cluster',
Component: YarnCluster,
},
{
path: 'tool',
Component: Tool,
},
{
path: 'task',
Component: Task,
},
{
path: 'ai',
Component: Ai,
children: [
{
index: true,
element: <Navigate to="/ai/inspection" replace/>,
},
{
path: 'inspection',
Component: Inspection,
},
{
path: 'conversation',
Component: Conversation,
},
],
},
],
},
]
export const menus: Route = {
export const menus = {
routes: [
{
path: '/',
@@ -85,7 +100,7 @@ export const menus: Route = {
icon: <InfoCircleOutlined/>,
routes: [
{
path: '/',
path: '/overview',
name: '概览',
icon: <InfoCircleOutlined/>,
},
@@ -120,7 +135,7 @@ export const menus: Route = {
icon: <CloudOutlined/>,
},
{
path: '/yarn_cluster',
path: 'a86f7c51-ae60-4ca4-8c4d-40b86b445a04',
name: '集群',
icon: <ClusterOutlined/>,
routes: [
@@ -152,6 +167,19 @@ export const menus: Route = {
{
path: '/ai',
name: 'AI',
}
icon: <OpenAIOutlined/>,
routes: [
{
path: '/ai/inspection',
name: '智能巡检',
icon: <CheckSquareOutlined/>,
},
{
path: '/ai/conversation',
name: '智慧问答',
icon: <QuestionOutlined/>,
},
],
},
],
}