Browse Source

feat: 添加agent菜单

dev-zw-agent
zhaowei 8 months ago
parent
commit
7ff0540816
9 changed files with 133 additions and 18 deletions
  1. +87
    -15
      react-ui/config/routes.ts
  2. +2
    -2
      react-ui/src/app.tsx
  3. +1
    -1
      react-ui/src/global.less
  4. +8
    -0
      react-ui/src/pages/Agent/Mine/index.tsx
  5. +8
    -0
      react-ui/src/pages/Agent/Model/index.tsx
  6. +8
    -0
      react-ui/src/pages/Agent/Plugin/index.tsx
  7. +8
    -0
      react-ui/src/pages/Agent/Publish/index.tsx
  8. +8
    -0
      react-ui/src/pages/Agent/Resource/index.tsx
  9. +3
    -0
      react-ui/src/utils/constant.ts

+ 87
- 15
react-ui/config/routes.ts View File

@@ -86,17 +86,7 @@ export default [
{
name: '数据准备',
path: '/datasetPreparation',
routes: [
{
path: '',
redirect: '/datasetPreparation/datasetAnnotation',
},
{
name: '数据标注',
path: 'datasetAnnotation',
component: './DatasetPreparation/DatasetAnnotation/index',
},
],
component: './DatasetPreparation/DatasetAnnotation/index',
},
{
name: '开发环境',
@@ -452,13 +442,53 @@ export default [
},
{
name: '应用开发',
path: '/appsDeployment',
path: '/apps',
routes: [
{
name: '应用开发',
name: '模型部署',
path: '',
key: 'appsDeployment',
component: './Application',
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',
},
],
},
],
},
@@ -619,6 +649,48 @@ export default [
},
],
},
{
name: 'agent',
path: '/agent',
routes: [
{
name: '智能体',
path: '',
key: 'agent',
redirect: '/agent/mine',
},
{
name: '发布管理',
path: 'publish',
key: 'publish',
component: './Agent/Publish',
},
{
name: '模型管理',
path: 'model',
key: 'model',
component: './Agent/Model',
},
{
name: '我的智能体',
path: 'mine',
key: 'mine',
component: './Agent/Mine',
},
{
name: '资源管理',
path: 'resource',
key: 'resource',
component: './Agent/Resource',
},
{
name: '插件市场',
path: 'plugin',
key: 'plugin',
component: './Agent/Plugin',
},
],
},
{
name: 'mixed',
path: '/mixed',


+ 2
- 2
react-ui/src/app.tsx View File

@@ -91,8 +91,8 @@ export const layout: RuntimeConfig['layout'] = ({ initialState }) => {
// if (initialState?.loading) return <PageLoading />;
return <PageContainer>{children}</PageContainer>;
},
collapsedButtonRender: false,
collapsed: initialState?.collapsed,
// collapsedButtonRender: false,
// collapsed: initialState?.collapsed,
menuProps: {
onClick: () => {
// 点击菜单项,删除所有的页面 state 缓存


+ 1
- 1
react-ui/src/global.less View File

@@ -72,7 +72,7 @@ body {
background-color: #fff;
}
.ant-pro-global-header-logo img {
height: 32px;
height: 22px;
}
.ant-pro-layout .ant-layout-sider.ant-pro-sider {
height: 100vh;


+ 8
- 0
react-ui/src/pages/Agent/Mine/index.tsx View File

@@ -0,0 +1,8 @@
import IframePage from '@/components/IFramePage';
import { AgentUrl } from '@/utils/constant';

function MineAgent() {
return <IframePage url={`${AgentUrl}/space/agent`}></IframePage>;
}

export default MineAgent;

+ 8
- 0
react-ui/src/pages/Agent/Model/index.tsx View File

@@ -0,0 +1,8 @@
import IframePage from '@/components/IFramePage';
import { AgentUrl } from '@/utils/constant';

function AgentModel() {
return <IframePage url={`${AgentUrl}/management/model`}></IframePage>;
}

export default AgentModel;

+ 8
- 0
react-ui/src/pages/Agent/Plugin/index.tsx View File

@@ -0,0 +1,8 @@
import IframePage from '@/components/IFramePage';
import { AgentUrl } from '@/utils/constant';

function AgentPlugin() {
return <IframePage url={`${AgentUrl}/store/plugin`}></IframePage>;
}

export default AgentPlugin;

+ 8
- 0
react-ui/src/pages/Agent/Publish/index.tsx View File

@@ -0,0 +1,8 @@
import IframePage from '@/components/IFramePage';
import { AgentUrl } from '@/utils/constant';

function AgentPublish() {
return <IframePage url={`${AgentUrl}/management/release`}></IframePage>;
}

export default AgentPublish;

+ 8
- 0
react-ui/src/pages/Agent/Resource/index.tsx View File

@@ -0,0 +1,8 @@
import IframePage from '@/components/IFramePage';
import { AgentUrl } from '@/utils/constant';

function AgentPublish() {
return <IframePage url={`${AgentUrl}/resource/plugin`}></IframePage>;
}

export default AgentPublish;

+ 3
- 0
react-ui/src/utils/constant.ts View File

@@ -23,3 +23,6 @@ export const ExperimentCompleted = 'ExperimentCompleted';

// 首页地址
export const HomeUrl = '/workspace';

// 讯飞智能体
export const AgentUrl = 'http://localhost:5173';

Loading…
Cancel
Save