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.

config.ts 3.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * @Author: 赵伟
  3. * @Date: 2025-01-08 14:30:58
  4. * @Description: 实验列表组件配置
  5. */
  6. import {
  7. batchDeleteActiveLearnInsReq,
  8. deleteActiveLearnInsReq,
  9. deleteActiveLearnReq,
  10. editActiveLearnInsReq,
  11. getActiveLearnInsListReq,
  12. getActiveLearnListReq,
  13. runActiveLearnReq,
  14. stopActiveLearnInsReq,
  15. } from '@/services/activeLearn';
  16. import {
  17. batchDeleteExperimentInsReq,
  18. deleteAutoMLReq,
  19. deleteExperimentInsReq,
  20. editExperimentInsReq,
  21. getAutoMLListReq,
  22. getExperimentInsListReq,
  23. runAutoMLReq,
  24. stopExperimentInsReq,
  25. } from '@/services/autoML';
  26. import {
  27. batchDeleteRayInsReq,
  28. deleteRayInsReq,
  29. deleteRayReq,
  30. editRayInsReq,
  31. getRayInsListReq,
  32. getRayListReq,
  33. runRayReq,
  34. stopRayInsReq,
  35. } from '@/services/hyperParameter';
  36. export enum ExperimentListType {
  37. AutoML = 'AutoML',
  38. HyperParameter = 'HyperParameter',
  39. ActiveLearn = 'ActiveLearn',
  40. }
  41. type ExperimentListInfo = {
  42. getListReq: (params: any, skipLoading?: boolean) => Promise<any>; // 获取列表
  43. getInsListReq: (params: any, skipLoading?: boolean) => Promise<any>; // 获取实例列表
  44. deleteRecordReq: (params: any) => Promise<any>; // 删除
  45. runRecordReq: (params: any) => Promise<any>; // 运行
  46. deleteInsReq: (params: any) => Promise<any>; // 删除实例
  47. batchDeleteInsReq: (params: any) => Promise<any>; // 批量删除实例
  48. stopInsReq: (params: any) => Promise<any>; // 终止实例
  49. editInsReq: (params: any) => Promise<any>; // 编辑实例
  50. title: string; // 标题
  51. pathPrefix: string; // 路由路径前缀
  52. idProperty: string; // ID属性
  53. nameProperty: string; // 名称属性
  54. descProperty: string; // 描述属性
  55. idInsProperty: string; // 实例返回的ID属性
  56. };
  57. export const experimentListConfig: Record<ExperimentListType, ExperimentListInfo> = {
  58. [ExperimentListType.AutoML]: {
  59. getListReq: getAutoMLListReq,
  60. getInsListReq: getExperimentInsListReq,
  61. deleteRecordReq: deleteAutoMLReq,
  62. runRecordReq: runAutoMLReq,
  63. deleteInsReq: deleteExperimentInsReq,
  64. batchDeleteInsReq: batchDeleteExperimentInsReq,
  65. stopInsReq: stopExperimentInsReq,
  66. editInsReq: editExperimentInsReq,
  67. title: '自动机器学习',
  68. pathPrefix: 'automl',
  69. nameProperty: 'name',
  70. descProperty: 'description',
  71. idProperty: 'machineLearnId',
  72. idInsProperty: 'machine_learn_id',
  73. },
  74. [ExperimentListType.HyperParameter]: {
  75. getListReq: getRayListReq,
  76. getInsListReq: getRayInsListReq,
  77. deleteRecordReq: deleteRayReq,
  78. runRecordReq: runRayReq,
  79. deleteInsReq: deleteRayInsReq,
  80. batchDeleteInsReq: batchDeleteRayInsReq,
  81. stopInsReq: stopRayInsReq,
  82. editInsReq: editRayInsReq,
  83. title: '超参数自动寻优',
  84. pathPrefix: 'hyperparameter',
  85. nameProperty: 'name',
  86. descProperty: 'description',
  87. idProperty: 'rayId',
  88. idInsProperty: 'ray_id',
  89. },
  90. [ExperimentListType.ActiveLearn]: {
  91. getListReq: getActiveLearnListReq,
  92. getInsListReq: getActiveLearnInsListReq,
  93. deleteRecordReq: deleteActiveLearnReq,
  94. runRecordReq: runActiveLearnReq,
  95. deleteInsReq: deleteActiveLearnInsReq,
  96. batchDeleteInsReq: batchDeleteActiveLearnInsReq,
  97. stopInsReq: stopActiveLearnInsReq,
  98. editInsReq: editActiveLearnInsReq,
  99. title: '自动学习',
  100. pathPrefix: 'active-learn',
  101. nameProperty: 'name',
  102. descProperty: 'description',
  103. idProperty: 'activeLearnId',
  104. idInsProperty: 'active_learn_id',
  105. },
  106. };