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

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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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: '/workspace',
  17. },
  18. {
  19. path: '*',
  20. layout: false,
  21. component: './404',
  22. },
  23. {
  24. path: '/user',
  25. layout: false,
  26. routes: [
  27. {
  28. name: 'login',
  29. path: '/user/login',
  30. component: './User/Login',
  31. },
  32. ],
  33. },
  34. {
  35. path: '/account',
  36. routes: [
  37. {
  38. name: 'acenter',
  39. path: '/account/center',
  40. component: './User/Center',
  41. },
  42. {
  43. name: 'asettings',
  44. path: '/account/settings',
  45. component: './User/Settings',
  46. },
  47. ],
  48. },
  49. {
  50. name: 'datasetPreparation',
  51. path: '/datasetPreparation',
  52. routes: [
  53. {
  54. name: 'datasetAnnotation',
  55. path: 'datasetAnnotation',
  56. component: './DatasetPreparation/DatasetAnnotation/index',
  57. },
  58. {
  59. name: '训练',
  60. path: 'pytorchtext/:id/:name',
  61. component: './Pipeline/editPipeline/index',
  62. },
  63. ],
  64. },
  65. {
  66. name: 'pipeline',
  67. path: '/pipeline',
  68. routes: [
  69. {
  70. name: '流水线',
  71. path: '/pipeline/pipelineText',
  72. component: './Pipeline/index',
  73. },
  74. {
  75. name: '训练',
  76. path: '/pipeline/pytorchtext/:id/:name',
  77. component: './Pipeline/editPipeline/index',
  78. },
  79. {
  80. name: '实验',
  81. path: '/pipeline/experimentText',
  82. component: './Experiment/index',
  83. },
  84. {
  85. name: '实验训练',
  86. path: '/pipeline/experimentPytorchtext/:workflowId/:id',
  87. component: './Experiment/experimentText/index',
  88. },
  89. ],
  90. },
  91. {
  92. name: 'developmentEnvironment',
  93. path: '/developmentEnvironment',
  94. routes: [
  95. {
  96. name: '开发环境',
  97. path: '',
  98. component: './DevelopmentEnvironment/index',
  99. },
  100. ],
  101. },
  102. {
  103. name: 'system',
  104. path: '/system',
  105. routes: [
  106. {
  107. name: '字典数据',
  108. path: '/system/dict-data/index/:id',
  109. component: './System/DictData',
  110. },
  111. {
  112. name: '分配用户',
  113. path: '/system/role-auth/user/:id',
  114. component: './System/Role/authUser',
  115. },
  116. ],
  117. },
  118. {
  119. name: 'dataset',
  120. path: '/dataset',
  121. routes: [
  122. {
  123. name: '数据集管理',
  124. path: '/dataset/datasetIndex',
  125. component: './Dataset/index',
  126. },
  127. {
  128. name: '数据集简介',
  129. path: '/dataset/datasetIntro/:id',
  130. component: './Dataset/datasetIntro',
  131. },
  132. {
  133. name: '镜像',
  134. path: 'mirror',
  135. routes: [
  136. {
  137. name: '镜像列表',
  138. path: '',
  139. component: './Mirror/list',
  140. },
  141. {
  142. name: '镜像详情',
  143. path: ':id',
  144. component: './Mirror/info',
  145. },
  146. {
  147. name: '创建镜像',
  148. path: 'create',
  149. component: './Mirror/create',
  150. },
  151. ],
  152. },
  153. {
  154. name: '模型管理',
  155. path: '/dataset/modelIndex',
  156. component: './Model/index',
  157. },
  158. {
  159. name: '模型简介',
  160. path: '/dataset/modelIntro/:id',
  161. component: './Model/modelIntro',
  162. },
  163. ],
  164. },
  165. {
  166. name: 'workspace',
  167. path: '/workspace',
  168. routes: [
  169. {
  170. name: '工作空间',
  171. path: '',
  172. key: 'workspace',
  173. component: './Workspace/index',
  174. },
  175. ],
  176. },
  177. {
  178. name: 'modelDseployment',
  179. path: '/modelDseployment',
  180. routes: [
  181. {
  182. name: '模型部署',
  183. path: '',
  184. key: 'modelDseployment',
  185. component: './missingPage.jsx',
  186. },
  187. ],
  188. },
  189. {
  190. name: 'appsDeployment',
  191. path: '/appsDeployment',
  192. routes: [
  193. {
  194. name: '应用开发',
  195. path: '',
  196. key: 'appsDeployment',
  197. component: './missingPage.jsx',
  198. },
  199. ],
  200. },
  201. {
  202. name: 'see',
  203. path: '/see',
  204. routes: [
  205. {
  206. name: '监控运维',
  207. path: '',
  208. key: 'see',
  209. component: './missingPage.jsx',
  210. },
  211. ],
  212. },
  213. {
  214. name: 'monitor',
  215. path: '/monitor',
  216. routes: [
  217. {
  218. name: '任务日志',
  219. path: '/monitor/job-log/index/:id',
  220. component: './Monitor/JobLog',
  221. },
  222. ],
  223. },
  224. {
  225. name: 'tool',
  226. path: '/tool',
  227. routes: [
  228. {
  229. name: '导入表',
  230. path: '/tool/gen/import',
  231. component: './Tool/Gen/import',
  232. },
  233. {
  234. name: '编辑表',
  235. path: '/tool/gen/edit',
  236. component: './Tool/Gen/edit',
  237. },
  238. ],
  239. },
  240. {
  241. name: 'docs',
  242. path: '/docs',
  243. routes: [
  244. {
  245. name: '使用指南',
  246. path: '',
  247. key: 'docs',
  248. component: './Docs/index',
  249. },
  250. ],
  251. },
  252. ];