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 15 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  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. path: '',
  92. redirect: '/datasetPreparation/datasetAnnotation',
  93. },
  94. {
  95. name: '数据标注',
  96. path: 'datasetAnnotation',
  97. component: './DatasetPreparation/DatasetAnnotation/index',
  98. },
  99. ],
  100. },
  101. {
  102. name: '开发环境',
  103. path: '/developmentEnvironment',
  104. routes: [
  105. {
  106. name: '开发环境',
  107. path: '',
  108. component: './DevelopmentEnvironment/List',
  109. },
  110. {
  111. name: '创建开发环境',
  112. path: 'create',
  113. component: './DevelopmentEnvironment/Create',
  114. },
  115. {
  116. name: '开发环境详情',
  117. path: 'editor',
  118. component: './DevelopmentEnvironment/Editor',
  119. },
  120. ],
  121. },
  122. {
  123. name: '流水线',
  124. path: '/pipeline',
  125. routes: [
  126. {
  127. path: '',
  128. redirect: '/pipeline/template',
  129. },
  130. {
  131. name: '流水线模板',
  132. path: '/pipeline/template',
  133. routes: [
  134. {
  135. name: '流水线模板',
  136. path: '',
  137. component: './Pipeline/index',
  138. },
  139. {
  140. name: '流水线详情',
  141. path: 'info/:id',
  142. component: './Pipeline/Info/index',
  143. },
  144. ],
  145. },
  146. {
  147. name: '实验',
  148. path: 'experiment',
  149. routes: [
  150. {
  151. name: '实验',
  152. path: '',
  153. component: './Experiment/index',
  154. },
  155. {
  156. name: '实验实例',
  157. path: 'instance/:workflowId/:id',
  158. component: './Experiment/Info/index',
  159. },
  160. {
  161. name: '实验对比',
  162. path: 'compare',
  163. routes: [
  164. {
  165. name: '实验对比',
  166. path: '',
  167. component: './Experiment/Comparison/index',
  168. },
  169. {
  170. name: '可视化对比',
  171. path: 'compare-visual',
  172. component: './Experiment/Aim/index',
  173. },
  174. ],
  175. },
  176. {
  177. name: '可视化',
  178. path: 'visual',
  179. component: './Experiment/Tensorboard/index',
  180. },
  181. ],
  182. },
  183. {
  184. name: '自动机器学习',
  185. path: 'automl',
  186. routes: [
  187. {
  188. name: '自动机器学习',
  189. path: '',
  190. component: './AutoML/List/index',
  191. },
  192. {
  193. name: '实验详情',
  194. path: 'info/:id',
  195. component: './AutoML/Info/index',
  196. },
  197. {
  198. name: '创建实验',
  199. path: 'create',
  200. component: './AutoML/Create/index',
  201. },
  202. {
  203. name: '编辑实验',
  204. path: 'edit/:id',
  205. component: './AutoML/Create/index',
  206. },
  207. {
  208. name: '复制实验',
  209. path: 'copy/:id',
  210. component: './AutoML/Create/index',
  211. },
  212. {
  213. name: '实验实例详情',
  214. path: 'instance/:experimentId/:id',
  215. component: './AutoML/Instance/index',
  216. },
  217. ],
  218. },
  219. {
  220. name: '超参数自动寻优',
  221. path: 'hyperparameter',
  222. routes: [
  223. {
  224. name: '超参数寻优',
  225. path: '',
  226. component: './HyperParameter/List/index',
  227. },
  228. {
  229. name: '实验详情',
  230. path: 'info/:id',
  231. component: './HyperParameter/Info/index',
  232. },
  233. {
  234. name: '创建实验',
  235. path: 'create',
  236. component: './HyperParameter/Create/index',
  237. },
  238. {
  239. name: '编辑实验',
  240. path: 'edit/:id',
  241. component: './HyperParameter/Create/index',
  242. },
  243. {
  244. name: '复制实验',
  245. path: 'copy/:id',
  246. component: './HyperParameter/Create/index',
  247. },
  248. {
  249. name: '实验实例详情',
  250. path: 'instance/:experimentId/:id',
  251. routes: [
  252. {
  253. name: '实验实例详情',
  254. path: '',
  255. component: './HyperParameter/Instance/index',
  256. },
  257. {
  258. name: '可视化对比',
  259. path: 'compare-visual',
  260. component: './HyperParameter/Aim/index',
  261. },
  262. ],
  263. },
  264. ],
  265. },
  266. {
  267. name: '主动学习',
  268. path: 'active-learn',
  269. routes: [
  270. {
  271. name: '超参数寻优',
  272. path: '',
  273. component: './ActiveLearn/List/index',
  274. },
  275. {
  276. name: '实验详情',
  277. path: 'info/:id',
  278. component: './ActiveLearn/Info/index',
  279. },
  280. {
  281. name: '创建实验',
  282. path: 'create',
  283. component: './ActiveLearn/Create/index',
  284. },
  285. {
  286. name: '编辑实验',
  287. path: 'edit/:id',
  288. component: './ActiveLearn/Create/index',
  289. },
  290. {
  291. name: '复制实验',
  292. path: 'copy/:id',
  293. component: './ActiveLearn/Create/index',
  294. },
  295. {
  296. name: '实验实例详情',
  297. path: 'instance/:experimentId/:id',
  298. component: './ActiveLearn/Instance/index',
  299. },
  300. ],
  301. },
  302. ],
  303. },
  304. {
  305. name: 'AI资产',
  306. path: '/dataset',
  307. routes: [
  308. {
  309. path: '',
  310. redirect: '/dataset/dataset',
  311. },
  312. {
  313. name: '数据集',
  314. path: 'dataset',
  315. routes: [
  316. {
  317. name: '数据集',
  318. path: '',
  319. component: './Dataset/index',
  320. },
  321. {
  322. name: '数据集简介',
  323. path: 'info/:id',
  324. component: './Dataset/intro',
  325. },
  326. ],
  327. },
  328. {
  329. name: '模型',
  330. path: 'model',
  331. routes: [
  332. {
  333. name: '模型',
  334. path: '',
  335. component: './Model/index',
  336. },
  337. {
  338. name: '模型简介',
  339. path: 'info/:id',
  340. component: './Model/intro',
  341. },
  342. ],
  343. },
  344. {
  345. name: '镜像',
  346. path: 'mirror',
  347. routes: [
  348. {
  349. name: '镜像',
  350. path: '',
  351. component: './Mirror/List',
  352. },
  353. {
  354. name: '镜像详情',
  355. path: 'info/:id',
  356. routes: [
  357. {
  358. name: '镜像详情',
  359. path: '',
  360. component: './Mirror/Info',
  361. },
  362. {
  363. name: '新增镜像版本',
  364. path: 'add-version',
  365. component: './Mirror/Create',
  366. },
  367. ],
  368. },
  369. {
  370. name: '创建镜像',
  371. path: 'create',
  372. component: './Mirror/Create',
  373. },
  374. ],
  375. },
  376. {
  377. name: '代码配置',
  378. path: 'codeConfig',
  379. routes: [
  380. {
  381. name: '代码配置',
  382. path: '',
  383. component: './CodeConfig/List',
  384. },
  385. ],
  386. },
  387. {
  388. name: '模型部署',
  389. path: 'modelDeployment',
  390. routes: [
  391. {
  392. name: '模型部署',
  393. path: '',
  394. component: './ModelDeployment/List',
  395. },
  396. {
  397. name: '创建推理服务',
  398. path: 'createService',
  399. component: './ModelDeployment/CreateService',
  400. },
  401. {
  402. name: '编辑推理服务',
  403. path: 'editService/:serviceId',
  404. component: './ModelDeployment/CreateService',
  405. },
  406. {
  407. name: '服务详情',
  408. path: 'serviceInfo/:serviceId',
  409. routes: [
  410. {
  411. name: '服务详情',
  412. path: '',
  413. component: './ModelDeployment/ServiceInfo',
  414. },
  415. {
  416. name: '新增服务版本',
  417. path: 'createVersion',
  418. component: './ModelDeployment/CreateVersion',
  419. },
  420. {
  421. name: '更新服务版本',
  422. path: 'updateVersion',
  423. component: './ModelDeployment/CreateVersion',
  424. },
  425. {
  426. name: '重启服务版本',
  427. path: 'restartVersion',
  428. component: './ModelDeployment/CreateVersion',
  429. },
  430. {
  431. name: '服务版本详情',
  432. path: 'versionInfo/:id',
  433. component: './ModelDeployment/VersionInfo',
  434. },
  435. ],
  436. },
  437. ],
  438. },
  439. {
  440. name: '知识图谱',
  441. path: 'knowledge',
  442. routes: [
  443. {
  444. name: '知识图谱',
  445. path: '',
  446. key: 'knowledge',
  447. component: './Knowledge/index',
  448. },
  449. ],
  450. },
  451. ],
  452. },
  453. {
  454. name: '应用开发',
  455. path: '/appsDeployment',
  456. routes: [
  457. {
  458. name: '应用开发',
  459. path: '',
  460. key: 'appsDeployment',
  461. component: './Application',
  462. },
  463. ],
  464. },
  465. {
  466. name: '监控运维',
  467. path: '/see',
  468. routes: [
  469. {
  470. name: '监控运维',
  471. path: '',
  472. key: 'see',
  473. component: './missingPage.jsx',
  474. },
  475. ],
  476. },
  477. {
  478. name: '资源',
  479. path: '/readad',
  480. routes: [
  481. {
  482. name: '资源',
  483. path: '',
  484. key: 'readad',
  485. component: './missingPage.jsx',
  486. },
  487. ],
  488. },
  489. {
  490. name: '组件',
  491. path: '/compent',
  492. routes: [
  493. {
  494. name: '组件',
  495. path: '',
  496. key: 'compent',
  497. component: './missingPage.jsx',
  498. },
  499. ],
  500. },
  501. {
  502. name: 'monitor',
  503. path: '/monitor',
  504. routes: [
  505. {
  506. name: '任务日志',
  507. path: '/monitor/job-log/index/:id',
  508. component: './Monitor/JobLog',
  509. },
  510. ],
  511. },
  512. {
  513. name: 'tool',
  514. path: '/tool',
  515. routes: [
  516. {
  517. name: '导入表',
  518. path: '/tool/gen/import',
  519. component: './Tool/Gen/import',
  520. },
  521. {
  522. name: '编辑表',
  523. path: '/tool/gen/edit',
  524. component: './Tool/Gen/edit',
  525. },
  526. ],
  527. },
  528. {
  529. name: '系统管理',
  530. path: '/system',
  531. routes: [
  532. {
  533. path: '',
  534. redirect: '/system/user',
  535. },
  536. {
  537. name: '用户管理',
  538. path: 'user',
  539. component: './System/User',
  540. },
  541. {
  542. name: '角色管理',
  543. path: 'role',
  544. component: './System/Role',
  545. },
  546. {
  547. name: '定时任务',
  548. path: 'job',
  549. component: './Monitor/Job',
  550. },
  551. {
  552. name: '菜单管理',
  553. path: 'menu',
  554. component: './System/Menu',
  555. },
  556. {
  557. name: '部门管理',
  558. path: 'dept',
  559. component: './System/Dept',
  560. },
  561. {
  562. name: '岗位管理',
  563. path: 'post',
  564. component: './System/Post',
  565. },
  566. {
  567. name: '字典管理',
  568. path: 'dict',
  569. component: './System/Dict',
  570. },
  571. {
  572. name: '字典数据',
  573. path: 'dict-data/index/:id',
  574. component: './System/DictData',
  575. },
  576. {
  577. name: '分配用户',
  578. path: 'role-auth/user/:id',
  579. component: './System/Role/authUser',
  580. },
  581. {
  582. name: '日志',
  583. path: 'log',
  584. routes: [
  585. {
  586. path: '',
  587. redirect: '/system/log/operlog',
  588. },
  589. ],
  590. },
  591. {
  592. name: '审核管理',
  593. path: 'approval',
  594. component: './System/Approval',
  595. },
  596. ],
  597. },
  598. {
  599. name: 'docs',
  600. path: '/docs',
  601. routes: [
  602. {
  603. name: '使用指南',
  604. path: '',
  605. key: 'docs',
  606. component: './Docs/index',
  607. },
  608. ],
  609. },
  610. {
  611. name: 'mixed',
  612. path: '/mixed',
  613. routes: [
  614. {
  615. name: '父子页面混合',
  616. path: '',
  617. key: 'mixed',
  618. component: './Mixed/index',
  619. },
  620. ],
  621. },
  622. {
  623. name: '算力积分',
  624. path: '/points',
  625. routes: [
  626. {
  627. name: '算力积分',
  628. path: '',
  629. key: 'points',
  630. component: './Points/index',
  631. },
  632. ],
  633. },
  634. {
  635. path: '/app1/*',
  636. name: '子应用1',
  637. microApp: 'app1',
  638. layout: true,
  639. },
  640. {
  641. path: '/app2/*',
  642. name: '子应用2',
  643. microApp: 'app2',
  644. layout: true,
  645. },
  646. {
  647. path: '*',
  648. layout: false,
  649. component: './404',
  650. },
  651. ];