You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.ts 16 kB

7 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. /**
  2. * @name umi 的路由配置
  3. * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
  4. * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
  5. * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
  6. * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
  7. * @param redirect 配置路由跳转
  8. * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
  9. * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题
  10. * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
  11. * @doc https://umijs.org/docs/guides/routes
  12. */
  13. export default [
  14. {
  15. path: '/',
  16. redirect: '/home',
  17. },
  18. {
  19. name: '首页',
  20. path: '/home',
  21. layout: false,
  22. routes: [
  23. {
  24. name: '首页',
  25. path: '',
  26. key: 'home',
  27. component: './Home/index',
  28. },
  29. ],
  30. },
  31. {
  32. name: '工作空间',
  33. path: '/workspace',
  34. routes: [
  35. {
  36. name: '工作空间',
  37. path: '',
  38. key: 'workspace',
  39. component: './Workspace/index',
  40. },
  41. {
  42. name: '消息中心',
  43. path: 'message',
  44. key: 'message',
  45. component: './Message/index',
  46. },
  47. ],
  48. },
  49. {
  50. path: '/authorize',
  51. layout: false,
  52. component: './Authorize/index',
  53. },
  54. {
  55. path: '/gitlink',
  56. layout: true,
  57. component: './GitLink/index',
  58. },
  59. {
  60. path: '/user',
  61. layout: false,
  62. routes: [
  63. {
  64. name: 'login',
  65. path: '/user/login',
  66. component: process.env.NO_SSO ? './User/Login/login' : './User/Login',
  67. },
  68. ],
  69. },
  70. {
  71. path: '/account',
  72. name: '用户中心',
  73. routes: [
  74. {
  75. name: '用户中心',
  76. path: '/account/center',
  77. component: './User/Center',
  78. },
  79. {
  80. name: '用户设置',
  81. path: '/account/settings',
  82. component: './User/Settings',
  83. },
  84. ],
  85. },
  86. {
  87. name: '数据标注',
  88. path: '/datasetPreparation',
  89. routes: [
  90. {
  91. key: 'datasetPreparation',
  92. path: '',
  93. name: '数据标注',
  94. component: './DatasetPreparation/DatasetAnnotation/index',
  95. },
  96. ],
  97. },
  98. {
  99. name: '开发环境',
  100. path: '/developmentEnvironment',
  101. routes: [
  102. {
  103. name: '开发环境',
  104. path: '',
  105. component: './DevelopmentEnvironment/List',
  106. },
  107. {
  108. name: '创建开发环境',
  109. path: 'create',
  110. component: './DevelopmentEnvironment/Create',
  111. },
  112. {
  113. name: '开发环境详情',
  114. path: 'editor',
  115. component: './DevelopmentEnvironment/Editor',
  116. },
  117. ],
  118. },
  119. {
  120. name: '流水线',
  121. path: '/pipeline',
  122. routes: [
  123. {
  124. path: '',
  125. redirect: '/pipeline/template',
  126. },
  127. {
  128. name: '流水线模板',
  129. path: '/pipeline/template',
  130. routes: [
  131. {
  132. name: '流水线模板',
  133. path: '',
  134. component: './Pipeline/index',
  135. },
  136. {
  137. name: '流水线详情',
  138. path: 'info/:id',
  139. component: './Pipeline/Info/index',
  140. },
  141. ],
  142. },
  143. {
  144. name: '实验',
  145. path: 'experiment',
  146. routes: [
  147. {
  148. name: '实验',
  149. path: '',
  150. component: './Experiment/index',
  151. },
  152. {
  153. name: '实验实例',
  154. path: 'instance/:workflowId/:id',
  155. component: './Experiment/Info/index',
  156. },
  157. {
  158. name: '实验对比',
  159. path: 'compare',
  160. routes: [
  161. {
  162. name: '实验对比',
  163. path: '',
  164. component: './Experiment/Comparison/index',
  165. },
  166. {
  167. name: '可视化对比',
  168. path: 'compare-visual',
  169. component: './Experiment/Aim/index',
  170. },
  171. ],
  172. },
  173. {
  174. name: '可视化',
  175. path: 'visual',
  176. component: './Experiment/Tensorboard/index',
  177. },
  178. ],
  179. },
  180. {
  181. name: '自动机器学习',
  182. path: 'automl',
  183. routes: [
  184. {
  185. name: '自动机器学习',
  186. path: '',
  187. component: './AutoML/List/index',
  188. },
  189. {
  190. name: '实验详情',
  191. path: 'info/:id',
  192. component: './AutoML/Info/index',
  193. },
  194. {
  195. name: '创建实验',
  196. path: 'create',
  197. component: './AutoML/Create/index',
  198. },
  199. {
  200. name: '编辑实验',
  201. path: 'edit/:id',
  202. component: './AutoML/Create/index',
  203. },
  204. {
  205. name: '复制实验',
  206. path: 'copy/:id',
  207. component: './AutoML/Create/index',
  208. },
  209. {
  210. name: '实验实例详情',
  211. path: 'instance/:experimentId/:id',
  212. component: './AutoML/Instance/index',
  213. },
  214. ],
  215. },
  216. {
  217. name: '超参数自动寻优',
  218. path: 'hyperparameter',
  219. routes: [
  220. {
  221. name: '超参数寻优',
  222. path: '',
  223. component: './HyperParameter/List/index',
  224. },
  225. {
  226. name: '实验详情',
  227. path: 'info/:id',
  228. component: './HyperParameter/Info/index',
  229. },
  230. {
  231. name: '创建实验',
  232. path: 'create',
  233. component: './HyperParameter/Create/index',
  234. },
  235. {
  236. name: '编辑实验',
  237. path: 'edit/:id',
  238. component: './HyperParameter/Create/index',
  239. },
  240. {
  241. name: '复制实验',
  242. path: 'copy/:id',
  243. component: './HyperParameter/Create/index',
  244. },
  245. {
  246. name: '实验实例详情',
  247. path: 'instance/:experimentId/:id',
  248. routes: [
  249. {
  250. name: '实验实例详情',
  251. path: '',
  252. component: './HyperParameter/Instance/index',
  253. },
  254. {
  255. name: '可视化对比',
  256. path: 'compare-visual',
  257. component: './HyperParameter/Aim/index',
  258. },
  259. ],
  260. },
  261. ],
  262. },
  263. {
  264. name: '主动学习',
  265. path: 'active-learn',
  266. routes: [
  267. {
  268. name: '超参数寻优',
  269. path: '',
  270. component: './ActiveLearn/List/index',
  271. },
  272. {
  273. name: '实验详情',
  274. path: 'info/:id',
  275. component: './ActiveLearn/Info/index',
  276. },
  277. {
  278. name: '创建实验',
  279. path: 'create',
  280. component: './ActiveLearn/Create/index',
  281. },
  282. {
  283. name: '编辑实验',
  284. path: 'edit/:id',
  285. component: './ActiveLearn/Create/index',
  286. },
  287. {
  288. name: '复制实验',
  289. path: 'copy/:id',
  290. component: './ActiveLearn/Create/index',
  291. },
  292. {
  293. name: '实验实例详情',
  294. path: 'instance/:experimentId/:id',
  295. component: './ActiveLearn/Instance/index',
  296. },
  297. ],
  298. },
  299. ],
  300. },
  301. {
  302. name: 'AI资产',
  303. path: '/dataset',
  304. routes: [
  305. {
  306. path: '',
  307. redirect: '/dataset/dataset',
  308. },
  309. {
  310. name: '数据集',
  311. path: 'dataset',
  312. routes: [
  313. {
  314. name: '数据集',
  315. path: '',
  316. component: './Dataset/index',
  317. },
  318. {
  319. name: '数据集简介',
  320. path: 'info/:id',
  321. component: './Dataset/intro',
  322. },
  323. ],
  324. },
  325. {
  326. name: '模型',
  327. path: 'model',
  328. routes: [
  329. {
  330. name: '模型',
  331. path: '',
  332. component: './Model/index',
  333. },
  334. {
  335. name: '模型简介',
  336. path: 'info/:id',
  337. component: './Model/intro',
  338. },
  339. ],
  340. },
  341. {
  342. name: '镜像',
  343. path: 'mirror',
  344. routes: [
  345. {
  346. name: '镜像',
  347. path: '',
  348. component: './Mirror/List',
  349. },
  350. {
  351. name: '镜像详情',
  352. path: 'info/:id',
  353. routes: [
  354. {
  355. name: '镜像详情',
  356. path: '',
  357. component: './Mirror/Info',
  358. },
  359. {
  360. name: '新增镜像版本',
  361. path: 'add-version',
  362. component: './Mirror/Create',
  363. },
  364. ],
  365. },
  366. {
  367. name: '创建镜像',
  368. path: 'create',
  369. component: './Mirror/Create',
  370. },
  371. ],
  372. },
  373. {
  374. name: '代码配置',
  375. path: 'codeConfig',
  376. routes: [
  377. {
  378. name: '代码配置',
  379. path: '',
  380. component: './CodeConfig/List',
  381. },
  382. ],
  383. },
  384. {
  385. name: '模型部署',
  386. path: 'modelDeployment',
  387. routes: [
  388. {
  389. name: '模型部署',
  390. path: '',
  391. component: './ModelDeployment/List',
  392. },
  393. {
  394. name: '创建推理服务',
  395. path: 'createService',
  396. component: './ModelDeployment/CreateService',
  397. },
  398. {
  399. name: '编辑推理服务',
  400. path: 'editService/:serviceId',
  401. component: './ModelDeployment/CreateService',
  402. },
  403. {
  404. name: '服务详情',
  405. path: 'serviceInfo/:serviceId',
  406. routes: [
  407. {
  408. name: '服务详情',
  409. path: '',
  410. component: './ModelDeployment/ServiceInfo',
  411. },
  412. {
  413. name: '新增服务版本',
  414. path: 'createVersion',
  415. component: './ModelDeployment/CreateVersion',
  416. },
  417. {
  418. name: '更新服务版本',
  419. path: 'updateVersion',
  420. component: './ModelDeployment/CreateVersion',
  421. },
  422. {
  423. name: '重启服务版本',
  424. path: 'restartVersion',
  425. component: './ModelDeployment/CreateVersion',
  426. },
  427. {
  428. name: '服务版本详情',
  429. path: 'versionInfo/:id',
  430. component: './ModelDeployment/VersionInfo',
  431. },
  432. ],
  433. },
  434. ],
  435. },
  436. {
  437. name: '知识图谱',
  438. path: 'knowledge',
  439. routes: [
  440. {
  441. name: '知识图谱',
  442. path: '',
  443. key: 'knowledge',
  444. component: './Knowledge/index',
  445. },
  446. ],
  447. },
  448. ],
  449. },
  450. {
  451. name: '应用开发',
  452. path: '/appsDeployment',
  453. routes: [
  454. {
  455. name: '应用开发',
  456. path: '',
  457. key: 'appsDeployment',
  458. component: './Application',
  459. },
  460. ],
  461. },
  462. {
  463. name: '监控运维',
  464. path: '/see',
  465. routes: [
  466. {
  467. name: '监控运维',
  468. path: '',
  469. key: 'see',
  470. component: './missingPage.jsx',
  471. },
  472. ],
  473. },
  474. {
  475. name: '资源',
  476. path: '/readad',
  477. routes: [
  478. {
  479. name: '资源',
  480. path: '',
  481. key: 'readad',
  482. component: './missingPage.jsx',
  483. },
  484. ],
  485. },
  486. {
  487. name: '组件',
  488. path: '/compent',
  489. routes: [
  490. {
  491. name: '组件',
  492. path: '',
  493. key: 'compent',
  494. component: './missingPage.jsx',
  495. },
  496. ],
  497. },
  498. {
  499. name: 'monitor',
  500. path: '/monitor',
  501. routes: [
  502. {
  503. name: '任务日志',
  504. path: '/monitor/job-log/index/:id',
  505. component: './Monitor/JobLog',
  506. },
  507. ],
  508. },
  509. {
  510. name: 'tool',
  511. path: '/tool',
  512. routes: [
  513. {
  514. name: '导入表',
  515. path: '/tool/gen/import',
  516. component: './Tool/Gen/import',
  517. },
  518. {
  519. name: '编辑表',
  520. path: '/tool/gen/edit',
  521. component: './Tool/Gen/edit',
  522. },
  523. ],
  524. },
  525. {
  526. name: '系统管理',
  527. path: '/system',
  528. routes: [
  529. {
  530. path: '',
  531. redirect: '/system/user',
  532. },
  533. {
  534. name: '用户管理',
  535. path: 'user',
  536. component: './System/User',
  537. },
  538. {
  539. name: '角色管理',
  540. path: 'role',
  541. component: './System/Role',
  542. },
  543. {
  544. name: '定时任务',
  545. path: 'job',
  546. component: './Monitor/Job',
  547. },
  548. {
  549. name: '菜单管理',
  550. path: 'menu',
  551. component: './System/Menu',
  552. },
  553. {
  554. name: '部门管理',
  555. path: 'dept',
  556. component: './System/Dept',
  557. },
  558. {
  559. name: '岗位管理',
  560. path: 'post',
  561. component: './System/Post',
  562. },
  563. {
  564. name: '字典管理',
  565. path: 'dict',
  566. component: './System/Dict',
  567. },
  568. {
  569. name: '字典数据',
  570. path: 'dict-data/index/:id',
  571. component: './System/DictData',
  572. },
  573. {
  574. name: '分配用户',
  575. path: 'role-auth/user/:id',
  576. component: './System/Role/authUser',
  577. },
  578. {
  579. name: '日志',
  580. path: 'log',
  581. routes: [
  582. {
  583. path: '',
  584. redirect: '/system/log/operlog',
  585. },
  586. ],
  587. },
  588. {
  589. name: '审核管理',
  590. path: 'approval',
  591. component: './System/Approval',
  592. },
  593. ],
  594. },
  595. {
  596. name: 'docs',
  597. path: '/docs',
  598. routes: [
  599. {
  600. name: '使用指南',
  601. path: '',
  602. key: 'docs',
  603. component: './Docs/index',
  604. },
  605. ],
  606. },
  607. {
  608. name: 'coze',
  609. path: '/coze',
  610. routes: [
  611. {
  612. name: '智能体编排',
  613. path: '',
  614. key: 'coze',
  615. component: './Coze/index',
  616. },
  617. ],
  618. },
  619. {
  620. name: 'mixed',
  621. path: '/mixed',
  622. routes: [
  623. {
  624. name: '父子页面混合',
  625. path: '',
  626. key: 'mixed',
  627. component: './Mixed/index',
  628. },
  629. ],
  630. },
  631. {
  632. name: '算力积分',
  633. path: '/points',
  634. routes: [
  635. {
  636. name: '算力积分',
  637. path: '',
  638. key: 'points',
  639. component: './Points/index',
  640. },
  641. ],
  642. },
  643. {
  644. path: '/app1/*',
  645. name: '子应用1',
  646. microApp: 'app1',
  647. layout: true,
  648. },
  649. {
  650. path: '/app2/*',
  651. name: '子应用2',
  652. microApp: 'app2',
  653. layout: true,
  654. },
  655. {
  656. path: '*',
  657. layout: false,
  658. component: './404',
  659. },
  660. ];