diff --git a/react-ui/config/config.ts b/react-ui/config/config.ts index 759d7c56..2e9ebf64 100644 --- a/react-ui/config/config.ts +++ b/react-ui/config/config.ts @@ -78,7 +78,6 @@ export default defineConfig({ */ title: '智能材料科研平台', layout: { - locale: false, ...defaultSettings, }, // keepalive: [/./], diff --git a/react-ui/config/defaultSettings.ts b/react-ui/config/defaultSettings.ts index d1842286..c4c59d2f 100644 --- a/react-ui/config/defaultSettings.ts +++ b/react-ui/config/defaultSettings.ts @@ -7,10 +7,11 @@ const Settings: ProLayoutProps & { pwa?: boolean; logo?: string; } = { + locale: 'zh-CN', navTheme: 'light', // 拂晓蓝 colorPrimary: '#1664ff', - layout: 'mix', + // layout: 'mix', contentWidth: 'Fluid', fixedHeader: false, fixSiderbar: false, @@ -18,7 +19,6 @@ const Settings: ProLayoutProps & { colorWeak: false, title: '智能材料科研平台', pwa: true, - logo: '/assets/images/left-top-logo.png', token: { // 参见ts声明,demo 见文档,通过token 修改样式 //https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F diff --git a/react-ui/config/routes.ts b/react-ui/config/routes.ts index 960a3cb0..c93f43a5 100644 --- a/react-ui/config/routes.ts +++ b/react-ui/config/routes.ts @@ -14,11 +14,19 @@ export default [ { path: '/', redirect: '/workspace', + breadcrumb: '工作空间', }, { - path: '*', - layout: false, - component: './404', + name: 'workspace', + path: '/workspace', + routes: [ + { + name: '工作空间', + path: '', + key: 'workspace', + component: './Workspace/index', + }, + ], }, { path: '/user', @@ -35,40 +43,64 @@ export default [ path: '/account', routes: [ { - name: 'acenter', + name: '用户中心', path: '/account/center', component: './User/Center', }, { - name: 'asettings', + name: '用户设置', path: '/account/settings', component: './User/Settings', }, ], }, { - name: 'datasetPreparation', + name: '数据准备', path: '/datasetPreparation', routes: [ { - name: 'datasetAnnotation', + path: '', + redirect: '/datasetPreparation/datasetAnnotation', + }, + { + name: '数据标注', path: 'datasetAnnotation', component: './DatasetPreparation/DatasetAnnotation/index', }, + ], + }, + { + name: 'developmentEnvironment', + path: '/developmentEnvironment', + routes: [ + { + name: '开发环境', + path: '', + component: './DevelopmentEnvironment/Editor', + }, { - name: '训练', - path: 'pytorchtext/:id/:name', - component: './Pipeline/editPipeline/index', + name: '创建编辑器', + path: 'create', + component: './DevelopmentEnvironment/Create', + }, + { + name: '编辑器', + path: 'editor', + component: './DevelopmentEnvironment/Editor', }, ], }, { - name: 'pipeline', + name: '流水线', path: '/pipeline', routes: [ + { + path: '', + redirect: '/pipeline/template', + }, { name: '流水线模板', - path: 'template', + path: '/pipeline/template', routes: [ { name: '流水线模板', @@ -77,8 +109,8 @@ export default [ }, { name: '流水线详情', - path: ':id', - component: './Pipeline/editPipeline/index', + path: 'info/:id', + component: './Pipeline/Info/index', }, ], }, @@ -92,8 +124,8 @@ export default [ component: './Experiment/index', }, { - name: '实验训练', - path: ':workflowId/:id', + name: '实验实例', + path: 'instance/:workflowId/:id', component: './Experiment/Info/index', }, { @@ -106,58 +138,25 @@ export default [ ], }, { - name: 'developmentEnvironment', - path: '/developmentEnvironment', + name: 'AI资产', + path: '/dataset', routes: [ { - name: '开发环境', path: '', - component: './DevelopmentEnvironment/Editor', - }, - { - name: '创建编辑器', - path: 'create', - component: './DevelopmentEnvironment/Create', - }, - { - name: '编辑器', - path: 'editor', - component: './DevelopmentEnvironment/Editor', + redirect: '/dataset/dataset', }, - ], - }, - { - name: 'system', - path: '/system', - routes: [ - { - name: '字典数据', - path: '/system/dict-data/index/:id', - component: './System/DictData', - }, - { - name: '分配用户', - path: '/system/role-auth/user/:id', - component: './System/Role/authUser', - }, - ], - }, - { - name: 'dataset', - path: '/dataset', - routes: [ { name: '数据集', path: 'dataset', routes: [ { - name: '数据集列表', + name: '数据集', path: '', component: './Dataset/index', }, { name: '数据集简介', - path: ':id', + path: 'info/:id', component: './Dataset/intro', }, ], @@ -167,13 +166,13 @@ export default [ path: 'model', routes: [ { - name: '模型列表', + name: '模型', path: '', component: './Model/index', }, { name: '模型简介', - path: ':id', + path: 'info/:id', component: './Model/intro', }, ], @@ -183,13 +182,13 @@ export default [ path: 'mirror', routes: [ { - name: '镜像列表', + name: '镜像', path: '', component: './Mirror/List', }, { name: '镜像详情', - path: ':id', + path: 'info/:id', component: './Mirror/Info', }, { @@ -201,42 +200,29 @@ export default [ }, ], }, - - { - name: 'workspace', - path: '/workspace', - routes: [ - { - name: '工作空间', - path: '', - key: 'workspace', - component: './Workspace/index', - }, - ], - }, { - name: 'modelDeployment', + name: '模型部署', path: '/modelDeployment', routes: [ { - name: '模型列表', + name: '模型部署', path: '', component: './ModelDeployment/List', }, { - name: '镜像详情', - path: ':id', + name: '模型部署详情', + path: 'info/:id', component: './ModelDeployment/Info', }, { - name: '创建镜像', + name: '创建推理服务', path: 'create', component: './ModelDeployment/Create', }, ], }, { - name: 'appsDeployment', + name: '应用开发', path: '/appsDeployment', routes: [ { @@ -248,7 +234,7 @@ export default [ ], }, { - name: 'see', + name: '监控运维', path: '/see', routes: [ { @@ -259,6 +245,30 @@ export default [ }, ], }, + { + 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', @@ -286,6 +296,61 @@ export default [ }, ], }, + { + name: '系统管理', + path: '/system', + routes: [ + { + path: '', + redirect: '/system/user', + }, + { + name: '用户管理', + path: '/system/user', + component: './System/User', + }, + { + name: '角色管理', + path: '/system/role', + component: './System/Role', + }, + { + name: '定时任务', + path: '/system/job', + component: './Monitor/Job', + }, + { + name: '菜单管理', + path: '/system/menu', + component: './System/Menu', + }, + { + name: '部门管理', + path: '/system/dept', + component: './System/Dept', + }, + { + name: '岗位管理', + path: '/system/post', + component: './System/Post', + }, + { + name: '字典管理', + path: '/system/dict', + component: './System/Dict', + }, + { + name: '字典数据', + path: '/system/dict-data/index/:id', + component: './System/DictData', + }, + { + name: '分配用户', + path: '/system/role-auth/user/:id', + component: './System/Role/authUser', + }, + ], + }, { name: 'docs', path: '/docs', @@ -298,4 +363,9 @@ export default [ }, ], }, + { + path: '*', + layout: false, + component: './404', + }, ]; diff --git a/react-ui/public/assets/images/delete-icon.png b/react-ui/public/assets/images/delete-icon.png deleted file mode 100644 index 310f8bb8..00000000 Binary files a/react-ui/public/assets/images/delete-icon.png and /dev/null differ diff --git a/react-ui/public/assets/images/fail-icon.png b/react-ui/public/assets/images/experiment-status/fail-icon.png similarity index 100% rename from react-ui/public/assets/images/fail-icon.png rename to react-ui/public/assets/images/experiment-status/fail-icon.png diff --git a/react-ui/public/assets/images/omitted-icon.png b/react-ui/public/assets/images/experiment-status/omitted-icon.png similarity index 100% rename from react-ui/public/assets/images/omitted-icon.png rename to react-ui/public/assets/images/experiment-status/omitted-icon.png diff --git a/react-ui/public/assets/images/pending-icon.png b/react-ui/public/assets/images/experiment-status/pending-icon.png similarity index 100% rename from react-ui/public/assets/images/pending-icon.png rename to react-ui/public/assets/images/experiment-status/pending-icon.png diff --git a/react-ui/public/assets/images/running-icon.png b/react-ui/public/assets/images/experiment-status/running-icon.png similarity index 100% rename from react-ui/public/assets/images/running-icon.png rename to react-ui/public/assets/images/experiment-status/running-icon.png diff --git a/react-ui/public/assets/images/success-icon.png b/react-ui/public/assets/images/experiment-status/success-icon.png similarity index 100% rename from react-ui/public/assets/images/success-icon.png rename to react-ui/public/assets/images/experiment-status/success-icon.png diff --git a/react-ui/public/assets/images/left-top-logo-1.png b/react-ui/public/assets/images/left-top-logo-1.png deleted file mode 100644 index 64bdaf2c..00000000 Binary files a/react-ui/public/assets/images/left-top-logo-1.png and /dev/null differ diff --git a/react-ui/public/assets/images/pipeline-back.png b/react-ui/public/assets/images/pipeline-back.png deleted file mode 100644 index ce00f428..00000000 Binary files a/react-ui/public/assets/images/pipeline-back.png and /dev/null differ diff --git a/react-ui/public/assets/images/upload-icon.png b/react-ui/public/assets/images/upload-icon.png deleted file mode 100644 index 74be5489..00000000 Binary files a/react-ui/public/assets/images/upload-icon.png and /dev/null differ diff --git a/react-ui/public/favicon.ico b/react-ui/public/favicon.ico index e2e93252..408b8a23 100644 Binary files a/react-ui/public/favicon.ico and b/react-ui/public/favicon.ico differ diff --git a/react-ui/src/app.tsx b/react-ui/src/app.tsx index 32dbf930..9f6db9b9 100644 --- a/react-ui/src/app.tsx +++ b/react-ui/src/app.tsx @@ -20,18 +20,14 @@ import { import './styles/menu.less'; export { requestConfig as request } from './requestConfig'; // const isDev = process.env.NODE_ENV === 'development'; +import { type GlobalInitialState } from '@/types'; import { menuItemRender } from '@/utils/menuRender'; import { gotoLoginPage } from './utils/ui'; + /** * @see https://umijs.org/zh-CN/plugins/plugin-initial-state * */ -export async function getInitialState(): Promise<{ - settings?: Partial; - currentUser?: API.CurrentUser; - loading?: boolean; - fetchUserInfo?: () => Promise; -}> { - // console.log('getInitialState'); +export async function getInitialState(): Promise { const fetchUserInfo = async () => { try { const response = await getUserInfo(); @@ -56,18 +52,20 @@ export async function getInitialState(): Promise<{ fetchUserInfo, currentUser, settings: defaultSettings as Partial, + collapsed: false, }; } return { fetchUserInfo, settings: defaultSettings as Partial, + collapsed: false, }; } // ProLayout 支持的api https://procomponents.ant.design/components/layout export const layout: RuntimeConfig['layout'] = ({ initialState }) => { return { - rightContentRender: () => , + rightContentRender: false, waterMarkProps: { // content: initialState?.currentUser?.nickName, }, @@ -91,7 +89,6 @@ export const layout: RuntimeConfig['layout'] = ({ initialState }) => { return getRemoteMenu(); }, }, - // footerRender: () =>