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

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