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 8.4 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
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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. name: '工作空间',
  20. path: '/workspace',
  21. routes: [
  22. {
  23. name: '工作空间',
  24. path: '',
  25. key: 'workspace',
  26. component: './Workspace/index',
  27. },
  28. ],
  29. },
  30. {
  31. path: '/user',
  32. layout: false,
  33. routes: [
  34. {
  35. name: 'login',
  36. path: '/user/login',
  37. component: './User/Login',
  38. },
  39. ],
  40. },
  41. {
  42. path: '/account',
  43. name: '用户中心',
  44. routes: [
  45. {
  46. name: '用户中心',
  47. path: '/account/center',
  48. component: './User/Center',
  49. },
  50. {
  51. name: '用户设置',
  52. path: '/account/settings',
  53. component: './User/Settings',
  54. },
  55. ],
  56. },
  57. {
  58. name: '数据准备',
  59. path: '/datasetPreparation',
  60. routes: [
  61. {
  62. path: '',
  63. redirect: '/datasetPreparation/datasetAnnotation',
  64. },
  65. {
  66. name: '数据标注',
  67. path: 'datasetAnnotation',
  68. component: './DatasetPreparation/DatasetAnnotation/index',
  69. },
  70. ],
  71. },
  72. {
  73. name: '开发环境',
  74. path: '/developmentEnvironment',
  75. routes: [
  76. {
  77. name: '开发环境',
  78. path: '',
  79. component: './DevelopmentEnvironment/List',
  80. },
  81. {
  82. name: '创建开发环境',
  83. path: 'create',
  84. component: './DevelopmentEnvironment/Create',
  85. },
  86. {
  87. name: '开发环境详情',
  88. path: 'editor',
  89. component: './DevelopmentEnvironment/Editor',
  90. },
  91. ],
  92. },
  93. {
  94. name: '流水线',
  95. path: '/pipeline',
  96. routes: [
  97. {
  98. path: '',
  99. redirect: '/pipeline/template',
  100. },
  101. {
  102. name: '流水线模板',
  103. path: '/pipeline/template',
  104. routes: [
  105. {
  106. name: '流水线模板',
  107. path: '',
  108. component: './Pipeline/index',
  109. },
  110. {
  111. name: '流水线详情',
  112. path: 'info/:id',
  113. component: './Pipeline/Info/index',
  114. },
  115. ],
  116. },
  117. {
  118. name: '实验',
  119. path: 'experiment',
  120. routes: [
  121. {
  122. name: '实验',
  123. path: '',
  124. component: './Experiment/index',
  125. },
  126. {
  127. name: '实验实例',
  128. path: 'instance/:workflowId/:id',
  129. component: './Experiment/Info/index',
  130. },
  131. {
  132. name: '实验对比',
  133. path: 'compare',
  134. component: './Experiment/Comparison/index',
  135. },
  136. ],
  137. },
  138. ],
  139. },
  140. {
  141. name: 'AI资产',
  142. path: '/dataset',
  143. routes: [
  144. {
  145. path: '',
  146. redirect: '/dataset/dataset',
  147. },
  148. {
  149. name: '数据集',
  150. path: 'dataset',
  151. routes: [
  152. {
  153. name: '数据集',
  154. path: '',
  155. component: './Dataset/index',
  156. },
  157. {
  158. name: '数据集简介',
  159. path: 'info/:id',
  160. component: './Dataset/intro',
  161. },
  162. ],
  163. },
  164. {
  165. name: '模型',
  166. path: 'model',
  167. routes: [
  168. {
  169. name: '模型',
  170. path: '',
  171. component: './Model/index',
  172. },
  173. {
  174. name: '模型简介',
  175. path: 'info/:id',
  176. component: './Model/intro',
  177. },
  178. ],
  179. },
  180. {
  181. name: '镜像',
  182. path: 'mirror',
  183. routes: [
  184. {
  185. name: '镜像',
  186. path: '',
  187. component: './Mirror/List',
  188. },
  189. {
  190. name: '镜像详情',
  191. path: 'info/:id',
  192. component: './Mirror/Info',
  193. },
  194. {
  195. name: '创建镜像',
  196. path: 'create',
  197. component: './Mirror/Create',
  198. },
  199. ],
  200. },
  201. ],
  202. },
  203. {
  204. name: '模型部署',
  205. path: '/modelDeployment',
  206. routes: [
  207. {
  208. name: '模型部署',
  209. path: '',
  210. component: './ModelDeployment/List',
  211. },
  212. {
  213. name: '模型部署详情',
  214. path: 'info/:id',
  215. component: './ModelDeployment/Info',
  216. },
  217. {
  218. name: '创建推理服务',
  219. path: 'create',
  220. component: './ModelDeployment/Create',
  221. },
  222. ],
  223. },
  224. {
  225. name: '应用开发',
  226. path: '/appsDeployment',
  227. routes: [
  228. {
  229. name: '应用开发',
  230. path: '',
  231. key: 'appsDeployment',
  232. component: './Application',
  233. },
  234. ],
  235. },
  236. {
  237. name: '监控运维',
  238. path: '/see',
  239. routes: [
  240. {
  241. name: '监控运维',
  242. path: '',
  243. key: 'see',
  244. component: './missingPage.jsx',
  245. },
  246. ],
  247. },
  248. {
  249. name: '资源',
  250. path: '/readad',
  251. routes: [
  252. {
  253. name: '资源',
  254. path: '',
  255. key: 'readad',
  256. component: './missingPage.jsx',
  257. },
  258. ],
  259. },
  260. {
  261. name: '组件',
  262. path: '/compent',
  263. routes: [
  264. {
  265. name: '组件',
  266. path: '',
  267. key: 'compent',
  268. component: './missingPage.jsx',
  269. },
  270. ],
  271. },
  272. {
  273. name: 'monitor',
  274. path: '/monitor',
  275. routes: [
  276. {
  277. name: '任务日志',
  278. path: '/monitor/job-log/index/:id',
  279. component: './Monitor/JobLog',
  280. },
  281. ],
  282. },
  283. {
  284. name: 'tool',
  285. path: '/tool',
  286. routes: [
  287. {
  288. name: '导入表',
  289. path: '/tool/gen/import',
  290. component: './Tool/Gen/import',
  291. },
  292. {
  293. name: '编辑表',
  294. path: '/tool/gen/edit',
  295. component: './Tool/Gen/edit',
  296. },
  297. ],
  298. },
  299. {
  300. name: '系统管理',
  301. path: '/system',
  302. routes: [
  303. {
  304. path: '',
  305. redirect: '/system/user',
  306. },
  307. {
  308. name: '用户管理',
  309. path: 'user',
  310. component: './System/User',
  311. },
  312. {
  313. name: '角色管理',
  314. path: 'role',
  315. component: './System/Role',
  316. },
  317. {
  318. name: '定时任务',
  319. path: 'job',
  320. component: './Monitor/Job',
  321. },
  322. {
  323. name: '菜单管理',
  324. path: 'menu',
  325. component: './System/Menu',
  326. },
  327. {
  328. name: '部门管理',
  329. path: 'dept',
  330. component: './System/Dept',
  331. },
  332. {
  333. name: '岗位管理',
  334. path: 'post',
  335. component: './System/Post',
  336. },
  337. {
  338. name: '字典管理',
  339. path: 'dict',
  340. component: './System/Dict',
  341. },
  342. {
  343. name: '字典数据',
  344. path: 'dict-data/index/:id',
  345. component: './System/DictData',
  346. },
  347. {
  348. name: '分配用户',
  349. path: 'role-auth/user/:id',
  350. component: './System/Role/authUser',
  351. },
  352. ],
  353. },
  354. {
  355. name: 'docs',
  356. path: '/docs',
  357. routes: [
  358. {
  359. name: '使用指南',
  360. path: '',
  361. key: 'docs',
  362. component: './Docs/index',
  363. },
  364. ],
  365. },
  366. {
  367. path: '*',
  368. layout: false,
  369. component: './404',
  370. },
  371. ];