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 7.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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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: 'template',
  72. routes: [
  73. {
  74. name: '流水线模板',
  75. path: '',
  76. component: './Pipeline/index',
  77. },
  78. {
  79. name: '流水线详情',
  80. path: ':id',
  81. component: './Pipeline/editPipeline/index',
  82. },
  83. ],
  84. },
  85. {
  86. name: '实验',
  87. path: 'experiment',
  88. routes: [
  89. {
  90. name: '实验',
  91. path: '',
  92. component: './Experiment/index',
  93. },
  94. {
  95. name: '实验训练',
  96. path: ':workflowId/:id',
  97. component: './Experiment/Info/index',
  98. },
  99. {
  100. name: '实验对比',
  101. path: 'compare',
  102. component: './Experiment/Comparison/index',
  103. },
  104. ],
  105. },
  106. ],
  107. },
  108. {
  109. name: 'developmentEnvironment',
  110. path: '/developmentEnvironment',
  111. routes: [
  112. {
  113. name: '开发环境',
  114. path: '',
  115. component: './DevelopmentEnvironment/List',
  116. },
  117. {
  118. name: '创建编辑器',
  119. path: 'create',
  120. component: './DevelopmentEnvironment/Create',
  121. },
  122. {
  123. name: '编辑器',
  124. path: 'editor',
  125. component: './DevelopmentEnvironment/Editor',
  126. },
  127. ],
  128. },
  129. {
  130. name: 'system',
  131. path: '/system',
  132. routes: [
  133. {
  134. name: '字典数据',
  135. path: '/system/dict-data/index/:id',
  136. component: './System/DictData',
  137. },
  138. {
  139. name: '分配用户',
  140. path: '/system/role-auth/user/:id',
  141. component: './System/Role/authUser',
  142. },
  143. ],
  144. },
  145. {
  146. name: 'dataset',
  147. path: '/dataset',
  148. routes: [
  149. {
  150. name: '数据集',
  151. path: 'dataset',
  152. routes: [
  153. {
  154. name: '数据集列表',
  155. path: '',
  156. component: './Dataset/index',
  157. },
  158. {
  159. name: '数据集简介',
  160. path: ':id',
  161. component: './Dataset/intro',
  162. },
  163. ],
  164. },
  165. {
  166. name: '模型',
  167. path: 'model',
  168. routes: [
  169. {
  170. name: '模型列表',
  171. path: '',
  172. component: './Model/index',
  173. },
  174. {
  175. name: '模型简介',
  176. path: ':id',
  177. component: './Model/intro',
  178. },
  179. ],
  180. },
  181. {
  182. name: '镜像',
  183. path: 'mirror',
  184. routes: [
  185. {
  186. name: '镜像列表',
  187. path: '',
  188. component: './Mirror/List',
  189. },
  190. {
  191. name: '镜像详情',
  192. path: ':id',
  193. component: './Mirror/Info',
  194. },
  195. {
  196. name: '创建镜像',
  197. path: 'create',
  198. component: './Mirror/Create',
  199. },
  200. ],
  201. },
  202. ],
  203. },
  204. {
  205. name: 'workspace',
  206. path: '/workspace',
  207. routes: [
  208. {
  209. name: '工作空间',
  210. path: '',
  211. key: 'workspace',
  212. component: './Workspace/index',
  213. },
  214. ],
  215. },
  216. {
  217. name: 'modelDeployment',
  218. path: '/modelDeployment',
  219. routes: [
  220. {
  221. name: '模型列表',
  222. path: '',
  223. component: './ModelDeployment/List',
  224. },
  225. {
  226. name: '镜像详情',
  227. path: ':id',
  228. component: './ModelDeployment/Info',
  229. },
  230. {
  231. name: '创建镜像',
  232. path: 'create',
  233. component: './ModelDeployment/Create',
  234. },
  235. ],
  236. },
  237. {
  238. name: 'appsDeployment',
  239. path: '/appsDeployment',
  240. routes: [
  241. {
  242. name: '应用开发',
  243. path: '',
  244. key: 'appsDeployment',
  245. component: './missingPage.jsx',
  246. },
  247. ],
  248. },
  249. {
  250. name: 'see',
  251. path: '/see',
  252. routes: [
  253. {
  254. name: '监控运维',
  255. path: '',
  256. key: 'see',
  257. component: './missingPage.jsx',
  258. },
  259. ],
  260. },
  261. {
  262. name: 'monitor',
  263. path: '/monitor',
  264. routes: [
  265. {
  266. name: '任务日志',
  267. path: '/monitor/job-log/index/:id',
  268. component: './Monitor/JobLog',
  269. },
  270. ],
  271. },
  272. {
  273. name: 'tool',
  274. path: '/tool',
  275. routes: [
  276. {
  277. name: '导入表',
  278. path: '/tool/gen/import',
  279. component: './Tool/Gen/import',
  280. },
  281. {
  282. name: '编辑表',
  283. path: '/tool/gen/edit',
  284. component: './Tool/Gen/edit',
  285. },
  286. ],
  287. },
  288. {
  289. name: 'docs',
  290. path: '/docs',
  291. routes: [
  292. {
  293. name: '使用指南',
  294. path: '',
  295. key: 'docs',
  296. component: './Docs/index',
  297. },
  298. ],
  299. },
  300. ];