/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @param name 配置路由的标题，默认读取国际化文件 menu.ts 中 menu.xxxx 的值，如配置 name 为 login，则读取 menu.ts 中 menu.login 的取值作为标题
 * @param icon 配置路由的图标，取值参考 https://ant.design/components/icon-cn， 注意去除风格后缀和大小写，如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward，如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
 * @doc https://umijs.org/docs/guides/routes
 */
export default [
  {
    path: '/',
    redirect: '/workspace',
  },
  {
    name: '工作空间',
    path: '/workspace',
    routes: [
      {
        name: '工作空间',
        path: '',
        key: 'workspace',
        component: './Workspace/index',
      },
    ],
  },
  {
    path: '/authorize',
    layout: false,
    component: './Authorize/index',
  },
  {
    path: '/gitlink',
    layout: true,
    component: './GitLink/index',
  },
  {
    path: '/user',
    layout: false,
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: process.env.NO_SSO ? './User/Login/login' : './User/Login',
      },
    ],
  },
  {
    path: '/account',
    name: '用户中心',
    routes: [
      {
        name: '用户中心',
        path: '/account/center',
        component: './User/Center',
      },
      {
        name: '用户设置',
        path: '/account/settings',
        component: './User/Settings',
      },
    ],
  },
  {
    name: '数据准备',
    path: '/datasetPreparation',
    routes: [
      {
        path: '',
        redirect: '/datasetPreparation/datasetAnnotation',
      },
      {
        name: '数据标注',
        path: 'datasetAnnotation',
        component: './DatasetPreparation/DatasetAnnotation/index',
      },
    ],
  },
  {
    name: '开发环境',
    path: '/developmentEnvironment',
    routes: [
      {
        name: '开发环境',
        path: '',
        component: './DevelopmentEnvironment/List',
      },
      {
        name: '创建开发环境',
        path: 'create',
        component: './DevelopmentEnvironment/Create',
      },
      {
        name: '开发环境详情',
        path: 'editor',
        component: './DevelopmentEnvironment/Editor',
      },
    ],
  },
  {
    name: '流水线',
    path: '/pipeline',
    routes: [
      {
        path: '',
        redirect: '/pipeline/template',
      },
      {
        name: '流水线模板',
        path: '/pipeline/template',
        routes: [
          {
            name: '流水线模板',
            path: '',
            component: './Pipeline/index',
          },
          {
            name: '流水线详情',
            path: 'info/:id',
            component: './Pipeline/Info/index',
          },
        ],
      },
      {
        name: '实验',
        path: 'experiment',
        routes: [
          {
            name: '实验',
            path: '',
            component: './Experiment/index',
          },
          {
            name: '实验实例',
            path: 'instance/:workflowId/:id',
            component: './Experiment/Info/index',
          },
          {
            name: '实验对比',
            path: 'compare',
            component: './Experiment/Comparison/index',
          },
          {
            name: '实验可视化对比',
            path: 'compare-visual',
            component: './Experiment/Aim/index',
          },
          {
            name: '可视化',
            path: 'visual',
            component: './Experiment/Tensorboard/index',
          },
        ],
      },
      {
        name: '自动机器学习',
        path: 'automl',
        routes: [
          {
            name: '自动机器学习',
            path: '',
            component: './AutoML/List/index',
          },
          {
            name: '实验详情',
            path: 'info/:id',
            component: './AutoML/Info/index',
          },
          {
            name: '创建实验',
            path: 'create',
            component: './AutoML/Create/index',
          },
          {
            name: '编辑实验',
            path: 'edit/:id',
            component: './AutoML/Create/index',
          },
          {
            name: '复制实验',
            path: 'copy/:id',
            component: './AutoML/Create/index',
          },
          {
            name: '实验实例详情',
            path: 'instance/:experimentId/:id',
            component: './AutoML/Instance/index',
          },
        ],
      },
      {
        name: '超参数自动寻优',
        path: 'hyperparameter',
        routes: [
          {
            name: '超参数寻优',
            path: '',
            component: './HyperParameter/List/index',
          },
          {
            name: '实验详情',
            path: 'info/:id',
            component: './HyperParameter/Info/index',
          },
          {
            name: '创建实验',
            path: 'create',
            component: './HyperParameter/Create/index',
          },
          {
            name: '编辑实验',
            path: 'edit/:id',
            component: './HyperParameter/Create/index',
          },
          {
            name: '复制实验',
            path: 'copy/:id',
            component: './HyperParameter/Create/index',
          },
          {
            name: '实验实例详情',
            path: 'instance/:experimentId/:id',
            component: './HyperParameter/Instance/index',
          },
        ],
      },
      {
        name: '主动学习',
        path: 'active-learn',
        routes: [
          {
            name: '超参数寻优',
            path: '',
            component: './ActiveLearn/List/index',
          },
          {
            name: '实验详情',
            path: 'info/:id',
            component: './ActiveLearn/Info/index',
          },
          {
            name: '创建实验',
            path: 'create',
            component: './ActiveLearn/Create/index',
          },
          {
            name: '编辑实验',
            path: 'edit/:id',
            component: './ActiveLearn/Create/index',
          },
          {
            name: '复制实验',
            path: 'copy/:id',
            component: './ActiveLearn/Create/index',
          },
          {
            name: '实验实例详情',
            path: 'instance/:experimentId/:id',
            component: './ActiveLearn/Instance/index',
          },
        ],
      },
    ],
  },
  {
    name: 'AI资产',
    path: '/dataset',
    routes: [
      {
        path: '',
        redirect: '/dataset/dataset',
      },
      {
        name: '数据集',
        path: 'dataset',
        routes: [
          {
            name: '数据集',
            path: '',
            component: './Dataset/index',
          },
          {
            name: '数据集简介',
            path: 'info/:id',
            component: './Dataset/intro',
          },
        ],
      },
      {
        name: '模型',
        path: 'model',
        routes: [
          {
            name: '模型',
            path: '',
            component: './Model/index',
          },
          {
            name: '模型简介',
            path: 'info/:id',
            component: './Model/intro',
          },
        ],
      },
      {
        name: '镜像',
        path: 'mirror',
        routes: [
          {
            name: '镜像',
            path: '',
            component: './Mirror/List',
          },
          {
            name: '镜像详情',
            path: 'info/:id',
            routes: [
              {
                name: '镜像详情',
                path: '',
                component: './Mirror/Info',
              },
              {
                name: '新增镜像版本',
                path: 'add-version',
                component: './Mirror/Create',
              },
            ],
          },
          {
            name: '创建镜像',
            path: 'create',
            component: './Mirror/Create',
          },
        ],
      },
      {
        name: '代码配置',
        path: 'codeConfig',
        routes: [
          {
            name: '代码配置',
            path: '',
            component: './CodeConfig/List',
          },
        ],
      },
      {
        name: '模型部署',
        path: 'modelDeployment',
        routes: [
          {
            name: '模型部署',
            path: '',
            component: './ModelDeployment/List',
          },
          {
            name: '创建推理服务',
            path: 'createService',
            component: './ModelDeployment/CreateService',
          },
          {
            name: '编辑推理服务',
            path: 'editService/:serviceId',
            component: './ModelDeployment/CreateService',
          },
          {
            name: '服务详情',
            path: 'serviceInfo/:serviceId',
            routes: [
              {
                name: '服务详情',
                path: '',
                component: './ModelDeployment/ServiceInfo',
              },
              {
                name: '新增服务版本',
                path: 'createVersion',
                component: './ModelDeployment/CreateVersion',
              },
              {
                name: '更新服务版本',
                path: 'updateVersion',
                component: './ModelDeployment/CreateVersion',
              },
              {
                name: '重启服务版本',
                path: 'restartVersion',
                component: './ModelDeployment/CreateVersion',
              },
              {
                name: '服务版本详情',
                path: 'versionInfo/:id',
                component: './ModelDeployment/VersionInfo',
              },
            ],
          },
        ],
      },
    ],
  },
  {
    name: '应用开发',
    path: '/appsDeployment',
    routes: [
      {
        name: '应用开发',
        path: '',
        key: 'appsDeployment',
        component: './Application',
      },
    ],
  },
  {
    name: '监控运维',
    path: '/see',
    routes: [
      {
        name: '监控运维',
        path: '',
        key: 'see',
        component: './missingPage.jsx',
      },
    ],
  },
  {
    name: '资源',
    path: '/readad',
    routes: [
      {
        name: '资源',
        path: '',
        key: 'readad',
        component: './missingPage.jsx',
      },
    ],
  },
  {
    name: '组件',
    path: '/compent',
    routes: [
      {
        name: '组件',
        path: '',
        key: 'compent',
        component: './missingPage.jsx',
      },
    ],
  },
  {
    name: 'monitor',
    path: '/monitor',
    routes: [
      {
        name: '任务日志',
        path: '/monitor/job-log/index/:id',
        component: './Monitor/JobLog',
      },
    ],
  },
  {
    name: 'tool',
    path: '/tool',
    routes: [
      {
        name: '导入表',
        path: '/tool/gen/import',
        component: './Tool/Gen/import',
      },
      {
        name: '编辑表',
        path: '/tool/gen/edit',
        component: './Tool/Gen/edit',
      },
    ],
  },
  {
    name: '系统管理',
    path: '/system',
    routes: [
      {
        path: '',
        redirect: '/system/user',
      },
      {
        name: '用户管理',
        path: 'user',
        component: './System/User',
      },
      {
        name: '角色管理',
        path: 'role',
        component: './System/Role',
      },
      {
        name: '定时任务',
        path: 'job',
        component: './Monitor/Job',
      },
      {
        name: '菜单管理',
        path: 'menu',
        component: './System/Menu',
      },
      {
        name: '部门管理',
        path: 'dept',
        component: './System/Dept',
      },
      {
        name: '岗位管理',
        path: 'post',
        component: './System/Post',
      },
      {
        name: '字典管理',
        path: 'dict',
        component: './System/Dict',
      },
      {
        name: '字典数据',
        path: 'dict-data/index/:id',
        component: './System/DictData',
      },
      {
        name: '分配用户',
        path: 'role-auth/user/:id',
        component: './System/Role/authUser',
      },
      {
        name: '日志',
        path: 'log',
        routes: [
          {
            path: '',
            redirect: '/system/log/operlog',
          },
        ],
      },
    ],
  },
  {
    name: 'docs',
    path: '/docs',
    routes: [
      {
        name: '使用指南',
        path: '',
        key: 'docs',
        component: './Docs/index',
      },
    ],
  },
  {
    name: '算力积分',
    path: '/points',
    routes: [
      {
        name: '算力积分',
        path: '',
        key: 'points',
        component: './Points/index',
      },
    ],
  },
  {
    name: '知识图谱',
    path: '/knowledge',
    routes: [
      {
        name: '知识图谱',
        path: '',
        key: 'knowledge',
        component: './Knowledge/index',
      },
    ],
  },
  {
    path: '*',
    layout: false,
    component: './404',
  },
];
