feat(web): 更换页面框架为pro-layout
This commit is contained in:
157
service-web/client/src/route.tsx
Normal file
157
service-web/client/src/route.tsx
Normal file
@@ -0,0 +1,157 @@
|
||||
import {
|
||||
CheckSquareOutlined,
|
||||
CloudOutlined,
|
||||
ClusterOutlined,
|
||||
CompressOutlined,
|
||||
InfoCircleOutlined,
|
||||
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 App from './pages/App.tsx'
|
||||
import Cloud from './pages/overview/Cloud.tsx'
|
||||
import Overview from './pages/Overview.tsx'
|
||||
import Queue from './pages/overview/Queue.tsx'
|
||||
import Table from './pages/overview/Table.tsx'
|
||||
import Task from './pages/overview/Task.tsx'
|
||||
import Tool from './pages/overview/Tool.tsx'
|
||||
import Version from './pages/overview/Version.tsx'
|
||||
import Yarn from './pages/overview/Yarn.tsx'
|
||||
import YarnCluster from './pages/overview/YarnCluster.tsx'
|
||||
import {commonInfo} from './util/amis.ts'
|
||||
|
||||
export const routes: RouteObject[] = [
|
||||
{
|
||||
path: '/',
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'ai',
|
||||
Component: Ai,
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
export const menus: Route = {
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: '概览',
|
||||
icon: <InfoCircleOutlined/>,
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: '概览',
|
||||
icon: <InfoCircleOutlined/>,
|
||||
},
|
||||
{
|
||||
path: '/table',
|
||||
name: '表任务',
|
||||
icon: <TableOutlined/>,
|
||||
},
|
||||
{
|
||||
path: '/queue',
|
||||
name: '压缩队列',
|
||||
icon: <CompressOutlined/>,
|
||||
},
|
||||
{
|
||||
path: '/version',
|
||||
name: '跨天',
|
||||
icon: <SunOutlined/>,
|
||||
},
|
||||
{
|
||||
path: `/yarn/${commonInfo.clusters.sync_names()}/root/Sync`,
|
||||
name: '同步集群',
|
||||
icon: <SyncOutlined/>,
|
||||
},
|
||||
{
|
||||
path: `/yarn/${commonInfo.clusters.compaction_names()}/default/Compaction`,
|
||||
name: '压缩集群',
|
||||
icon: <SyncOutlined/>,
|
||||
},
|
||||
{
|
||||
path: '/cloud',
|
||||
name: '服务',
|
||||
icon: <CloudOutlined/>,
|
||||
},
|
||||
{
|
||||
path: '/yarn_cluster',
|
||||
name: '集群',
|
||||
icon: <ClusterOutlined/>,
|
||||
routes: [
|
||||
{
|
||||
path: '/yarn_cluster',
|
||||
name: '概览',
|
||||
icon: <InfoCircleOutlined/>,
|
||||
},
|
||||
...Object.keys(commonInfo.clusters.compaction).map(name => ({
|
||||
// @ts-ignore
|
||||
path: `/yarn/${name}/${commonInfo.clusters.compaction[name]}`,
|
||||
name: `${name} 集群`,
|
||||
icon: <ClusterOutlined/>,
|
||||
})),
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/tool',
|
||||
name: '工具',
|
||||
icon: <ToolOutlined/>,
|
||||
},
|
||||
{
|
||||
path: '/task',
|
||||
name: '任务',
|
||||
icon: <CheckSquareOutlined/>,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/ai',
|
||||
name: 'AI',
|
||||
}
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user