| @@ -67,11 +67,6 @@ export default [ | |||||
| path: 'datasetAnnotation', | path: 'datasetAnnotation', | ||||
| component: './DatasetPreparation/DatasetAnnotation/index', | component: './DatasetPreparation/DatasetAnnotation/index', | ||||
| }, | }, | ||||
| { | |||||
| name: '训练', | |||||
| path: 'pytorchtext/:id/:name', | |||||
| component: './Pipeline/editPipeline/index', | |||||
| }, | |||||
| ], | ], | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -115,7 +110,7 @@ export default [ | |||||
| { | { | ||||
| name: '流水线详情', | name: '流水线详情', | ||||
| path: 'info/:id', | path: 'info/:id', | ||||
| component: './Pipeline/editPipeline/index', | |||||
| component: './Pipeline/Info/index', | |||||
| }, | }, | ||||
| ], | ], | ||||
| }, | }, | ||||
| @@ -12,59 +12,7 @@ type Route = { | |||||
| key?: string; | key?: string; | ||||
| }; | }; | ||||
| const routes: Route[] = [ | |||||
| { | |||||
| name: 'pipeline', | |||||
| path: '/pipeline', | |||||
| breadcrumb: '流水线', | |||||
| routes: [ | |||||
| { | |||||
| name: '流水线模板', | |||||
| path: 'template', | |||||
| breadcrumb: '流水线模板', | |||||
| routes: [ | |||||
| { | |||||
| name: '流水线模板', | |||||
| path: '', | |||||
| component: './Pipeline/index', | |||||
| breadcrumb: '流水线模板', | |||||
| }, | |||||
| { | |||||
| name: '流水线详情', | |||||
| path: ':id', | |||||
| component: './Pipeline/editPipeline/index', | |||||
| breadcrumb: '流水线详情', | |||||
| }, | |||||
| ], | |||||
| }, | |||||
| { | |||||
| name: '实验', | |||||
| path: 'experiment', | |||||
| breadcrumb: '实验', | |||||
| routes: [ | |||||
| { | |||||
| name: '实验', | |||||
| path: '', | |||||
| component: './Experiment/index', | |||||
| breadcrumb: '实验', | |||||
| }, | |||||
| { | |||||
| name: '实验训练', | |||||
| path: ':workflowId/:id', | |||||
| component: './Experiment/Info/index', | |||||
| breadcrumb: '实验训练', | |||||
| }, | |||||
| { | |||||
| name: '实验对比', | |||||
| path: 'compare', | |||||
| component: './Experiment/Comparison/index', | |||||
| breadcrumb: '实验对比', | |||||
| }, | |||||
| ], | |||||
| }, | |||||
| ], | |||||
| }, | |||||
| ]; | |||||
| const routes: Route[] = []; | |||||
| const KFBreadcrumb = () => { | const KFBreadcrumb = () => { | ||||
| const location = useLocation(); | const location = useLocation(); | ||||
| @@ -2,17 +2,16 @@ import KFIcon from '@/components/KFIcon'; | |||||
| import { useStateRef, useVisible } from '@/hooks'; | import { useStateRef, useVisible } from '@/hooks'; | ||||
| import { getWorkflowById, saveWorkflow } from '@/services/pipeline/index.js'; | import { getWorkflowById, saveWorkflow } from '@/services/pipeline/index.js'; | ||||
| import themes from '@/styles/theme.less'; | import themes from '@/styles/theme.less'; | ||||
| import { fittingString } from '@/utils'; | |||||
| import { fittingString, s8 } from '@/utils'; | |||||
| import { to } from '@/utils/promise'; | import { to } from '@/utils/promise'; | ||||
| import G6 from '@antv/g6'; | import G6 from '@antv/g6'; | ||||
| import { useNavigate, useParams } from '@umijs/max'; | |||||
| import { App, Button } from 'antd'; | import { App, Button } from 'antd'; | ||||
| import { useEffect, useRef } from 'react'; | import { useEffect, useRef } from 'react'; | ||||
| import { useNavigate, useParams } from 'react-router-dom'; | |||||
| import { s8 } from '../../../utils'; | |||||
| import GlobalParamsDrawer from '../components/GlobalParamsDrawer'; | import GlobalParamsDrawer from '../components/GlobalParamsDrawer'; | ||||
| import ModelMenu from '../components/ModelMenu'; | import ModelMenu from '../components/ModelMenu'; | ||||
| import Props from '../components/PipelineNodeDrawer'; | |||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| import Props from './props'; | |||||
| import { findAllParentNodes } from './utils'; | import { findAllParentNodes } from './utils'; | ||||
| let graph = null; | let graph = null; | ||||
| @@ -4,6 +4,7 @@ import ParameterSelect from '@/components/ParameterSelect'; | |||||
| import SubAreaTitle from '@/components/SubAreaTitle'; | import SubAreaTitle from '@/components/SubAreaTitle'; | ||||
| import { CommonTabKeys } from '@/enums'; | import { CommonTabKeys } from '@/enums'; | ||||
| import { useComputingResource } from '@/hooks/resource'; | import { useComputingResource } from '@/hooks/resource'; | ||||
| import { canInput, createMenuItems } from '@/pages/Pipeline/Info/utils'; | |||||
| import { | import { | ||||
| PipelineGlobalParam, | PipelineGlobalParam, | ||||
| PipelineNodeModel, | PipelineNodeModel, | ||||
| @@ -16,13 +17,12 @@ import { INode } from '@antv/g6'; | |||||
| import { Button, Drawer, Form, Input, MenuProps, Select } from 'antd'; | import { Button, Drawer, Form, Input, MenuProps, Select } from 'antd'; | ||||
| import { NamePath } from 'antd/es/form/interface'; | import { NamePath } from 'antd/es/form/interface'; | ||||
| import { forwardRef, useImperativeHandle, useState } from 'react'; | import { forwardRef, useImperativeHandle, useState } from 'react'; | ||||
| import PropsLabel from '../components/PropsLabel'; | |||||
| import PropsLabel from '../PropsLabel'; | |||||
| import ResourceSelectorModal, { | import ResourceSelectorModal, { | ||||
| ResourceSelectorType, | ResourceSelectorType, | ||||
| selectorTypeConfig, | selectorTypeConfig, | ||||
| } from '../components/ResourceSelectorModal'; | |||||
| import styles from './props.less'; | |||||
| import { canInput, createMenuItems } from './utils'; | |||||
| } from '../ResourceSelectorModal'; | |||||
| import styles from './index.less'; | |||||
| const { TextArea } = Input; | const { TextArea } = Input; | ||||
| type PipelineNodeParameterProps = { | type PipelineNodeParameterProps = { | ||||
| @@ -49,7 +49,9 @@ | |||||
| &__bottom-img { | &__bottom-img { | ||||
| width: 100%; | width: 100%; | ||||
| height: calc(100% - 300px); | |||||
| margin-top: 50px; | margin-top: 50px; | ||||
| object-fit: contain; | |||||
| } | } | ||||
| } | } | ||||
| @@ -2,7 +2,7 @@ import { MenuDataItem } from '@ant-design/pro-components'; | |||||
| import { request } from '@umijs/max'; | import { request } from '@umijs/max'; | ||||
| import React, { lazy } from 'react'; | import React, { lazy } from 'react'; | ||||
| let remoteMenu: any = null; | |||||
| let remoteMenu: any = []; | |||||
| export function getRemoteMenu() { | export function getRemoteMenu() { | ||||
| return remoteMenu; | return remoteMenu; | ||||
| @@ -22,6 +22,7 @@ function patchRouteItems(route: any, menu: any, parentPath: string) { | |||||
| if (routeChild.path === menuItem.path) { | if (routeChild.path === menuItem.path) { | ||||
| hasItem = true; | hasItem = true; | ||||
| newItem = routeChild; | newItem = routeChild; | ||||
| break; | |||||
| } | } | ||||
| } | } | ||||
| if (!hasItem) { | if (!hasItem) { | ||||
| @@ -42,7 +43,7 @@ function patchRouteItems(route: any, menu: any, parentPath: string) { | |||||
| path += '/'; | path += '/'; | ||||
| } | } | ||||
| if (name !== 'index') { | if (name !== 'index') { | ||||
| path += name.at(0)?.toUpperCase() + name.substr(1); | |||||
| path += name.at(0)?.toUpperCase() + name.substring(1); | |||||
| } else { | } else { | ||||
| path += name; | path += name; | ||||
| } | } | ||||
| @@ -101,10 +102,8 @@ export function convertCompatRouters(childrens: API.RoutersMenuItem[]): any[] { | |||||
| return childrens.map((item: API.RoutersMenuItem) => { | return childrens.map((item: API.RoutersMenuItem) => { | ||||
| return { | return { | ||||
| path: item.path, | path: item.path, | ||||
| // icon:'icon-a-057_fenlei', | |||||
| icon: 'icon-' + item.meta.icon, | |||||
| // icon: item.meta.icon, | |||||
| name: item.meta.title, | |||||
| icon: item.meta?.icon ? 'icon-' + item.meta.icon : undefined, | |||||
| name: item.meta?.title, | |||||
| routes: item.children ? convertCompatRouters(item.children) : undefined, | routes: item.children ? convertCompatRouters(item.children) : undefined, | ||||
| hideChildrenInMenu: item.hidden, | hideChildrenInMenu: item.hidden, | ||||
| hideInMenu: item.hidden, | hideInMenu: item.hidden, | ||||
| @@ -4,3 +4,28 @@ export const loginUserKey = 'login-user'; | |||||
| export const loginPasswordKey = 'login-password'; | export const loginPasswordKey = 'login-password'; | ||||
| // 记住密码 | // 记住密码 | ||||
| export const rememberPasswordKey = 'login-remember-password'; | export const rememberPasswordKey = 'login-remember-password'; | ||||
| export const getLocalStorageItem = (key: string, isObject: boolean = false) => { | |||||
| const jsonStr = localStorage.getItem(key); | |||||
| if (!isObject) { | |||||
| return jsonStr; | |||||
| } | |||||
| if (jsonStr) { | |||||
| try { | |||||
| return JSON.parse(jsonStr); | |||||
| } catch (error) { | |||||
| return undefined; | |||||
| } | |||||
| } | |||||
| return undefined; | |||||
| }; | |||||
| export const setLocalStorageItem = (key: string, state?: any, isObject: boolean = false) => { | |||||
| if (state) { | |||||
| localStorage.setItem(key, isObject ? JSON.stringify(state) : state); | |||||
| } | |||||
| }; | |||||
| export const removeLocalStorageItem = (key: string) => { | |||||
| localStorage.removeItem(key); | |||||
| }; | |||||
| @@ -3,7 +3,7 @@ export const mirrorNameKey = 'mirror-name'; | |||||
| // 模型部署 | // 模型部署 | ||||
| export const modelDeploymentInfoKey = 'model-deployment-info'; | export const modelDeploymentInfoKey = 'model-deployment-info'; | ||||
| // 编辑器 url | // 编辑器 url | ||||
| export const editorUrl = 'editor-url'; | |||||
| export const editorUrlKey = 'editor-url'; | |||||
| export const getSessionStorageItem = (key: string, isObject: boolean = false) => { | export const getSessionStorageItem = (key: string, isObject: boolean = false) => { | ||||
| const jsonStr = sessionStorage.getItem(key); | const jsonStr = sessionStorage.getItem(key); | ||||