(
12 | (set, get) => ({
13 | tempNode:[],
14 | setTempNode: data => {
15 | set(state => ({
16 | tempNode: data,
17 | }));
18 | },
19 | addTempNode: data => {
20 | set(state => ({
21 | tempNode: [...state.tempNode, data],
22 | }));
23 | },
24 |
25 | }),
26 | { name: 'useDataStore' },
27 | ),
28 | );
29 | export default useDataStore;
30 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/hooks/useNodeIdUpdate.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { useEffect } from 'react';
5 | import useStore from '../store';
6 | import { AppNode } from '../types';
7 |
8 | const useNodeIdUpdate = (update: (nodeId: string, node: AppNode) => void) => {
9 | const selectedNode = useStore(state => state.selectedNode);
10 | const showChildNode = useStore(state => state.showChildNode);
11 | useEffect(() => {
12 | update(selectedNode?.id || '', selectedNode);
13 | }, [selectedNode, showChildNode]);
14 | };
15 | function getNestedKeys(obj, path = []) {
16 | let result = [];
17 | for (let key in obj) {
18 | if (typeof obj[key] === 'object' && obj[key] !== null) {
19 | result.push(...getNestedKeys(obj[key], path.concat(key)));
20 | } else {
21 | result.push(path.concat(key));
22 | }
23 | }
24 | return result;
25 | }
26 | export default useNodeIdUpdate;
27 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/hooks/useNodeManagement.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { useState } from 'react';
5 |
6 | const useNodeManagement = () => {
7 | const [nodes, setNodes] = useState([]);
8 |
9 | const addNode = newNode => {
10 | setNodes(prevNodes => [...prevNodes, newNode]);
11 | };
12 |
13 | return { nodes, addNode };
14 | };
15 |
16 | export default useNodeManagement;
17 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/hooks/useOutsideClick.ts:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react';
2 |
3 | /**
4 | * A custom hook to listen for clicks outside of a given element.
5 | * @param {React.MutableRefObject} ref - The ref of the element to check clicks against.
6 | * @param {Function} onOutsideClick - The callback function to call when a click occurs outside the element.
7 | */
8 | function useOutsideClick(ref, onOutsideClick) {
9 | useEffect(() => {
10 | function handleClickOutside(event) {
11 | if (ref.current && !ref.current.contains(event.target)) {
12 | onOutsideClick(event);
13 | }
14 | }
15 |
16 | // Add event listeners in the capture phase
17 | document.addEventListener('mousedown', handleClickOutside, true);
18 | document.addEventListener('touchstart', handleClickOutside, true);
19 | document.addEventListener('mouseup', handleClickOutside, true);
20 | document.addEventListener('touchend', handleClickOutside, true);
21 |
22 | return () => {
23 | // Remove event listeners in the capture phase
24 | document.removeEventListener('mousedown', handleClickOutside, true);
25 | document.removeEventListener('touchstart', handleClickOutside, true);
26 | document.removeEventListener('mouseup', handleClickOutside, true);
27 | document.removeEventListener('touchend', handleClickOutside, true);
28 | };
29 | }, [ref, onOutsideClick]);
30 | }
31 |
32 | export default useOutsideClick;
33 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/hooks/usePageVisibilityEffect .ts:
--------------------------------------------------------------------------------
1 | import { useEffect } from 'react';
2 | import { useLocation, useNavigate } from 'react-router-dom';
3 |
4 | type PageVisibilityEffectOptions = {
5 | onBeforeUnload?: (event: BeforeUnloadEvent) => void;
6 | onRouteChange?: (location: Location) => void;
7 | };
8 | const usePageVisibilityEffect = ({
9 | onBeforeUnload,
10 | onRouteChange,
11 | }: PageVisibilityEffectOptions) => {
12 | const location = useLocation();
13 | const navigate = useNavigate();
14 |
15 | useEffect(() => {
16 |
17 | const handleBeforeUnload = event => {
18 | if (onBeforeUnload) {
19 | onBeforeUnload(event);
20 | }
21 | };
22 |
23 |
24 | window.addEventListener('beforeunload', handleBeforeUnload);
25 |
26 |
27 | if (onRouteChange) {
28 | onRouteChange(location);
29 | }
30 |
31 |
32 | return () => {
33 | window.removeEventListener('beforeunload', handleBeforeUnload);
34 | };
35 | }, [location, onBeforeUnload, onRouteChange]);
36 | };
37 |
38 | export default usePageVisibilityEffect;
39 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/Agent/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import useStore from '../../store';
7 | import CustomHandle from '../CustomHandle';
8 |
9 | export default memo((props: NodeProps) => {
10 | const edges = useStore(state => state.edges);
11 |
12 | // Check if current node is connected to executor_list
13 | const isConnectedToExecutorList = edges.some(
14 | edge =>
15 | edge.source === props.id &&
16 | edge.targetHandle === 'executor_list'
17 | );
18 |
19 | return (
20 |
21 | {!isConnectedToExecutorList && (
22 |
28 | )}
29 |
35 |
36 | );
37 | });
38 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/CustomCode/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import CustomHandle from '../CustomHandle';
7 |
8 | export default memo((props: NodeProps) => {
9 | return (
10 |
11 |
17 |
23 | {/*
24 | */}
25 |
26 | );
27 | });
28 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/End/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import CustomHandle from '../CustomHandle';
7 |
8 | export default memo((props: NodeProps) => {
9 | return (
10 |
11 |
17 |
18 |
19 | );
20 | });
21 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/Http/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { Typography } from 'antd';
6 | import { memo } from 'react';
7 | import CustomHandle from '../CustomHandle';
8 | const { Text } = Typography;
9 | export default memo((props: NodeProps) => {
10 | return (
11 |
12 |
18 |
24 |
25 |
26 |
27 |
{props?.data?.method}
28 |
29 |
34 | {props?.data?.url}
35 |
36 |
37 |
38 |
39 |
40 | );
41 | });
42 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/Human/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import VariableInNode from '../../components/VariableInNode';
7 | import CustomHandle from '../CustomHandle';
8 |
9 | export default memo((props: NodeProps) => {
10 | return (
11 |
12 |
18 |
24 |
25 |
26 |
27 |
28 | );
29 | });
30 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/Retriever/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import CustomHandle from '../CustomHandle';
7 |
8 | export default memo((props: NodeProps) => {
9 | return (
10 |
11 |
18 |
24 |
25 |
26 | );
27 | });
28 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/Skill/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import CustomHandle from '../CustomHandle';
7 |
8 | export default memo((props: NodeProps) => {
9 | return (
10 |
11 |
17 |
23 |
24 |
25 | );
26 | });
27 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/Start/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | /*
5 | * @LastEditors: biz
6 | */
7 | import { NodeProps, Position } from '@xyflow/react';
8 | import { memo } from 'react';
9 | import VariableInNode from '../../components/VariableInNode';
10 | import CustomHandle from '../CustomHandle';
11 |
12 | export default memo((props: NodeProps) => {
13 | return (
14 |
15 |
22 | {/* */}
23 |
24 |
25 | );
26 | });
27 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/TaskGeneration/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import useStore from '../../store';
7 | import CustomHandle from '../CustomHandle';
8 |
9 | export default memo((props: NodeProps) => {
10 | const { data, id } = props;
11 |
12 | const modelData = useStore(state => state.modelData);
13 | const modelList = () => {
14 | return modelData?.list?.find(x => x.model_config_id == props.data?.model)?.model_name;
15 | };
16 |
17 | return (
18 |
19 |
26 |
27 | {/*
*/}
28 |
34 |
35 | {data.model && (
36 |
37 | {modelList()}
38 |
39 | )}
40 |
41 |
42 | );
43 | });
44 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/TemplateConversion/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import CustomHandle from '../CustomHandle';
7 |
8 | export default memo((props: NodeProps) => {
9 | return (
10 |
11 |
17 |
23 | {/* */}
24 | {/* */}
25 |
26 | );
27 | });
28 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/nodes/ToolNode/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { NodeProps, Position } from '@xyflow/react';
5 | import { memo } from 'react';
6 | import CustomHandle from '../CustomHandle';
7 |
8 | export default memo((props: NodeProps) => {
9 | return (
10 |
11 |
17 |
23 | {/*
24 | */}
25 |
26 | );
27 | });
28 |
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/propertyNodes/types.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { BlockEnum, PropertyNodeEnum } from '../types';
5 |
6 | export interface PropertyNodeData {
7 | title: string;
8 | entitle: string;
9 | desc: string;
10 | descTools: string;
11 | endescTools: string;
12 | propertyType: PropertyNodeEnum;
13 | targetNodeTypes: BlockEnum[];
14 | outputInfo?: {
15 | key: string;
16 | type: string;
17 | base: boolean;
18 | };
19 | }
20 |
21 | export interface PropertyNodeConfig {
22 | node: any;
23 | panel: any;
24 | icon: PropertyNodeEnum;
25 | title: string;
26 | entitle: string;
27 | base: {
28 | type: PropertyNodeEnum;
29 | data: PropertyNodeData;
30 | };
31 | }
32 |
33 | export type PropertyNodeCustomType = {
34 | [key in PropertyNodeEnum]: PropertyNodeConfig;
35 | };
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/transformRules.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { BlockEnum, NodeTypeTransformRules } from './types';
5 |
6 | // Define transform rules for TaskExecution node
7 | const taskExecutionRules = {
8 | handles: [
9 | {
10 | handleId: 'executor_list',
11 | transform: (sourceNode) => ({
12 | currentId: sourceNode.id,
13 | isChild: true
14 | })
15 | }
16 | ]
17 | };
18 |
19 | // Rules for each node type
20 | export const transformRules: NodeTypeTransformRules = {
21 | [BlockEnum.TaskExecution]: taskExecutionRules,
22 | // Add rules for other node types as needed
23 | };
--------------------------------------------------------------------------------
/web/src/components/WorkFlow/utils/analysisVariable.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 |
5 | export default function parseText(
6 | text: string,
7 | ): { identifier: string; ioType: string; fieldName: string }[] {
8 | const pattern = /<<([0-9a-fA-F\-]+)\.(inputs|outputs)\.([^>]+)>>/g;
9 | const results: { identifier: string; ioType: string; fieldName: string }[] = [];
10 |
11 | let match: RegExpExecArray | null;
12 | while ((match = pattern.exec(text)) !== null) {
13 | const identifier = match[1];
14 | const ioType = match[2];
15 | const fieldName = match[3];
16 | results.push({ identifier, ioType, fieldName });
17 | }
18 |
19 | return results;
20 | }
21 |
--------------------------------------------------------------------------------
/web/src/components/bottomlabel.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | const bottomlabel: React.FC = () => {
4 |
5 | return (
6 |
10 |
v106.4.9.0 Res v106.4.9.135
11 |
12 | );
13 | };
14 | export default bottomlabel;
15 |
--------------------------------------------------------------------------------
/web/src/components/callword.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: wnagchi 1305bcd@gmail.com
3 | */
4 | /*
5 | * @LastEditors: biz
6 | */
7 | import { QuestionCircleOutlined } from '@ant-design/icons';
8 | import { Tooltip } from 'antd';
9 | import React, { useEffect } from 'react';
10 |
11 | interface ChildProps {
12 | title: any;
13 | name: any;
14 | className?: any;
15 | required?: any;
16 | }
17 | const callword: React.FC = ({ title, name, className, required }) => {
18 |
19 |
20 | useEffect(() => {}, []);
21 | return (
22 |
23 |
24 | {required ? '*' : ''} {name}
25 |
26 |
27 |
28 |
29 |
30 | );
31 | };
32 | export default callword;
33 |
--------------------------------------------------------------------------------
/web/src/components/headportrait.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import React, { useEffect } from 'react';
5 |
6 | interface ChildProps {
7 | Image: any;
8 | icon?: any;
9 | avatar?: any;
10 | size?: string;
11 | }
12 | const headportrait: React.FC = ({ Image, icon, avatar, size = '42' }) => {
13 | useEffect(() => {}, []);
14 | return (
15 |
18 |
19 |

20 |
21 | {icon ? (
22 |
23 |

24 |
25 | ) : null}
26 |
27 | );
28 | };
29 | export default headportrait;
30 |
--------------------------------------------------------------------------------
/web/src/components/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import Footer from './Footer';
3 | import { Question, SelectLang } from './RightContent';
4 | import { AvatarDropdown, AvatarName } from './RightContent/AvatarDropdown';
5 |
6 | export { AvatarDropdown, AvatarName, Footer, Question, SelectLang };
7 |
--------------------------------------------------------------------------------
/web/src/db/contentLibrary.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/db/contentLibrary.ts
--------------------------------------------------------------------------------
/web/src/db/test.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/db/test.ts
--------------------------------------------------------------------------------
/web/src/hooks/useBacklogList.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { getBacklogsList } from '@/api/workflow';
5 | import useUserStore from '@/store/user';
6 | import useSocketStore from '@/store/websocket';
7 | import { useRequest } from 'ahooks';
8 | import { useState } from 'react';
9 |
10 | export const useBacklogList = () => {
11 | const [backlogData, setBacklogData] = useState(null);
12 | const listenBakLogs = useSocketStore(state =>
13 | state.filterMessages('workflow_need_human_confirm'),
14 | );
15 | const workflowProgress = useSocketStore(state => state.filterMessages('workflow_run_progress'));
16 | const prevConfirmDealtWith = useUserStore(state => state.prevConfirmDealtWith);
17 | const { loading, runAsync } = useRequest(
18 | async () => {
19 | const res = await getBacklogsList({
20 | current: 1,
21 | pageSize: 10,
22 | });
23 | return res.data;
24 | },
25 | {
26 | refreshDeps: [listenBakLogs.length, workflowProgress.length, prevConfirmDealtWith],
27 | onSuccess: result => {
28 | setBacklogData(result);
29 | },
30 | },
31 | );
32 | return {
33 | loading,
34 | data: backlogData,
35 | refresh: runAsync,
36 | };
37 | };
38 |
--------------------------------------------------------------------------------
/web/src/hooks/useResetPanel.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import useStore from '@/components/WorkFlow/store';
5 | import useUserStore from '@/store/user';
6 |
7 | export const useResetPanel = () => {
8 | const setSelect = useStore(state => state.setSelect);
9 | const setRunId = useUserStore(state => state.setRunId);
10 | const setDealtWithData = useUserStore(state => state.setDealtWithData);
11 | return () => {
12 | setRunId(null);
13 | setDealtWithData(null);
14 | setSelect(null);
15 | };
16 | };
17 |
--------------------------------------------------------------------------------
/web/src/layout/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 |
5 | import AgentCreate from '@/components/AgentCreate';
6 | import SkillCreate from '@/components/SkillCreate';
7 | import DealtWithForLog from '@/components/WorkFlow/components/DealtWith/DealtWithForLog';
8 | import RunPanelLog from '@/components/LogPanel/RunPanelLog';
9 | import RunWorkFlow from '@/components/WorkFlow/RunWorkFlow';
10 | import React from 'react';
11 |
12 | interface PlazaProps {
13 | children: React.ReactNode;
14 | }
15 |
16 | const PageWrap: React.FC = ({ children }) => {
17 | return (
18 |
19 |
{children}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | );
28 | };
29 |
30 | export default PageWrap;
31 |
--------------------------------------------------------------------------------
/web/src/loading.tsx:
--------------------------------------------------------------------------------
1 | import { Spin } from "antd";
2 |
3 | /*
4 | * @LastEditors: biz
5 | */
6 | export default function Loading() {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/web/src/locales/en-US.json:
--------------------------------------------------------------------------------
1 | {
2 | "createkb.uploadToKnowledgeBase": "Upload to Knowledge Base",
3 | "createkb.splitContent": "Split Content",
4 | "createkb.splitType": "Split Type",
5 | "createkb.chunkSize": "Chunk Size",
6 | "createkb.chunkOverlap": "Chunk Overlap",
7 | "createkb.fileList": "File List:",
8 | "createkb.deleteFile": "Delete File"
9 | }
--------------------------------------------------------------------------------
/web/src/locales/en-US/component.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | export default {
5 | 'component.tagSelect.expand': 'Expand',
6 | 'component.tagSelect.collapse': 'Collapse',
7 | 'component.tagSelect.all': 'All',
8 | 'component.menu.title1': 'Menu Title 1',
9 | 'component.menu.dashboard': 'Home',
10 | 'component.menu.chatRoomList': 'Meeting Room List',
11 | 'component.menu.chatRoom': 'Meeting Room',
12 | 'component.menu.meeting': 'Roundtable',
13 | 'component.menu.title2': 'Menu Title 2',
14 | 'component.menu.workspace': 'Workspace',
15 | 'component.menu.workflow': 'Workflow',
16 | 'component.menu.title3': 'Menu Title 3',
17 | 'component.menu.creation': 'Creation',
18 | 'component.menu.agent': 'Agent',
19 | 'component.menu.skill': 'Skill',
20 | 'component.menu.knowledgeBase': 'Knowledge Base',
21 | 'component.menu.teamAgent': 'Team Agent',
22 | 'component.menu.teamSkill': 'Team Skill',
23 | 'component.label.teamVisible': 'Team Visible',
24 | 'component.tooltip.publishWorkflowFirst': 'Please publish the workflow first',
25 | 'component.menu.backToPreviousPage': 'Back to Previous Page',
26 | 'component.menu.edit': 'Edit',
27 | 'component.menu.setting': 'Setting',
28 | 'component.menu.arrange': 'Arrange',
29 | 'component.menu.accessAPI': 'Access API',
30 | 'component.tooltip.enableAPIFirst': 'Please enable the API first',
31 | 'component.menu.log': 'Log',
32 | };
33 |
--------------------------------------------------------------------------------
/web/src/locales/en-US/globalHeader.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'component.globalHeader.search': 'Search',
3 | 'component.globalHeader.search.example1': 'Search example 1',
4 | 'component.globalHeader.search.example2': 'Search example 2',
5 | 'component.globalHeader.search.example3': 'Search example 3',
6 | 'component.globalHeader.help': 'Help',
7 | 'component.globalHeader.notification': 'Notification',
8 | 'component.globalHeader.notification.empty': 'You have viewed all notifications.',
9 | 'component.globalHeader.message': 'Message',
10 | 'component.globalHeader.message.empty': 'You have viewed all messsages.',
11 | 'component.globalHeader.event': 'Event',
12 | 'component.globalHeader.event.empty': 'You have viewed all events.',
13 | 'component.noticeIcon.clear': 'Clear',
14 | 'component.noticeIcon.cleared': 'Cleared',
15 | 'component.noticeIcon.empty': 'No notifications',
16 | 'component.noticeIcon.view-more': 'View more',
17 | };
18 |
--------------------------------------------------------------------------------
/web/src/locales/en-US/pwa.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'app.pwa.offline': 'You are offline now',
3 | 'app.pwa.serviceworker.updated': 'New content is available',
4 | 'app.pwa.serviceworker.updated.hint':
5 | 'Please press the "Refresh" button to reload current page',
6 | 'app.pwa.serviceworker.updated.ok': 'Refresh',
7 | };
8 |
--------------------------------------------------------------------------------
/web/src/locales/zh-CN.json:
--------------------------------------------------------------------------------
1 | {
2 | "createkb.uploadToKnowledgeBase": "上传到知识库",
3 | "createkb.splitContent": "是否分段",
4 | "createkb.splitType": "分段类型",
5 | "createkb.chunkSize": "分段长度",
6 | "createkb.chunkOverlap": "分段重叠长度",
7 | "createkb.fileList": "文件列表:",
8 | "createkb.deleteFile": "删除文件"
9 | }
--------------------------------------------------------------------------------
/web/src/locales/zh-CN/component.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | export default {
5 | 'component.tagSelect.expand': '展开',
6 | 'component.tagSelect.collapse': '收起',
7 | 'component.tagSelect.all': '全部',
8 | 'component.menu.title1': '菜单标题1',
9 | 'component.menu.dashboard': '首页',
10 | 'component.menu.chatRoomList': '会议室列表',
11 | 'component.menu.chatRoom': '会议室',
12 | 'component.menu.meeting': '圆桌',
13 | 'component.menu.title2': '菜单标题2',
14 | 'component.menu.workspace': '工作区',
15 | 'component.menu.workflow': '工作流',
16 | 'component.menu.title3': '菜单标题3',
17 | 'component.menu.creation': '创造',
18 | 'component.menu.agent': '智能体',
19 | 'component.menu.skill': '技能',
20 | 'component.menu.knowledgeBase': '知识库',
21 | 'component.menu.teamAgent': '团队Agent',
22 | 'component.menu.teamSkill': '团队技能',
23 | 'component.label.teamVisible': '团队可见',
24 | 'component.tooltip.publishWorkflowFirst': '请先发布工作流',
25 | 'component.menu.backToPreviousPage': '返回前一页',
26 | 'component.menu.edit': '编辑',
27 | 'component.menu.setting': '设置',
28 | 'component.menu.arrange': '编排',
29 | 'component.menu.accessAPI': '访问API',
30 | 'component.tooltip.enableAPIFirst': '请先开启API',
31 | 'component.menu.log': '日志',
32 | 'menu.knowledgebase': '知识库',
33 | };
34 |
--------------------------------------------------------------------------------
/web/src/locales/zh-CN/globalHeader.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'component.globalHeader.search': '站内搜索',
3 | 'component.globalHeader.search.example1': '搜索提示一',
4 | 'component.globalHeader.search.example2': '搜索提示二',
5 | 'component.globalHeader.search.example3': '搜索提示三',
6 | 'component.globalHeader.help': '使用文档',
7 | 'component.globalHeader.notification': '通知',
8 | 'component.globalHeader.notification.empty': '你已查看所有通知',
9 | 'component.globalHeader.message': '消息',
10 | 'component.globalHeader.message.empty': '您已读完所有消息',
11 | 'component.globalHeader.event': '待办',
12 | 'component.globalHeader.event.empty': '你已完成所有待办',
13 | 'component.noticeIcon.clear': '清空',
14 | 'component.noticeIcon.cleared': '清空了',
15 | 'component.noticeIcon.empty': '暂无数据',
16 | 'component.noticeIcon.view-more': '查看更多',
17 | };
18 |
--------------------------------------------------------------------------------
/web/src/locales/zh-CN/pwa.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'app.pwa.offline': '当前处于离线状态',
3 | 'app.pwa.serviceworker.updated': '有新内容',
4 | 'app.pwa.serviceworker.updated.hint': '请点击“刷新”按钮或者手动刷新页面',
5 | 'app.pwa.serviceworker.updated.ok': '刷新',
6 | };
7 |
--------------------------------------------------------------------------------
/web/src/locales/zh-CN/settingDrawer.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | 'app.setting.pagestyle': '整体风格设置',
3 | 'app.setting.pagestyle.dark': '暗色菜单风格',
4 | 'app.setting.pagestyle.light': '亮色菜单风格',
5 | 'app.setting.content-width': '内容区域宽度',
6 | 'app.setting.content-width.fixed': '定宽',
7 | 'app.setting.content-width.fluid': '流式',
8 | 'app.setting.themecolor': '主题色',
9 | 'app.setting.themecolor.dust': '薄暮',
10 | 'app.setting.themecolor.volcano': '火山',
11 | 'app.setting.themecolor.sunset': '日暮',
12 | 'app.setting.themecolor.cyan': '明青',
13 | 'app.setting.themecolor.green': '极光绿',
14 | 'app.setting.themecolor.daybreak': '拂晓蓝(默认)',
15 | 'app.setting.themecolor.geekblue': '极客蓝',
16 | 'app.setting.themecolor.purple': '酱紫',
17 | 'app.setting.navigationmode': '导航模式',
18 | 'app.setting.sidemenu': '侧边菜单布局',
19 | 'app.setting.topmenu': '顶部菜单布局',
20 | 'app.setting.fixedheader': '固定 Header',
21 | 'app.setting.fixedsidebar': '固定侧边菜单',
22 | 'app.setting.fixedsidebar.hint': '侧边菜单布局时可配置',
23 | 'app.setting.hideheader': '下滑时隐藏 Header',
24 | 'app.setting.hideheader.hint': '固定 Header 时可配置',
25 | 'app.setting.othersettings': '其他设置',
26 | 'app.setting.weakmode': '色弱模式',
27 | 'app.setting.copy': '拷贝设置',
28 | 'app.setting.copyinfo': '拷贝成功,请到 config/defaultSettings.js 中替换默认配置',
29 | 'app.setting.production.hint':
30 | '配置栏只在开发环境用于预览,生产环境不会展现,请拷贝后手动修改配置文件',
31 | };
32 |
--------------------------------------------------------------------------------
/web/src/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "NexusAI",
3 | "short_name": "NexusAI",
4 | "display": "standalone",
5 | "start_url": "./?utm_source=homescreen",
6 | "theme_color": "#002140",
7 | "background_color": "#001529",
8 | "icons": [
9 | {
10 | "src": "icons/icon-192x192.png",
11 | "sizes": "192x192"
12 | },
13 | {
14 | "src": "icons/icon-128x128.png",
15 | "sizes": "128x128"
16 | },
17 | {
18 | "src": "icons/icon-512x512.png",
19 | "sizes": "512x512"
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/web/src/pages/404.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import { history, useIntl } from '@umijs/max';
5 | import { Button, Result } from 'antd';
6 | import React from 'react';
7 |
8 | const NoFoundPage: React.FC = () => (
9 | history.push('/')}>
15 | {useIntl().formatMessage({ id: 'pages.404.buttonText' })}
16 |
17 | }
18 | />
19 | );
20 |
21 | export default NoFoundPage;
22 |
--------------------------------------------------------------------------------
/web/src/pages/User/Login/__snapshots__/login.test.tsx.snap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/pages/User/Login/__snapshots__/login.test.tsx.snap
--------------------------------------------------------------------------------
/web/src/pages/WorkSpace/WorkFlow/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | import WorkFlowLeftMenu from '@/components/WorkFlow/components/Menu/WorkFlowLeftMenu';
5 | import WorkFlow from '@/components/WorkFlow';
6 | import React from 'react';
7 |
8 | const WorkSpace: React.FC = () => {
9 | return (
10 |
11 | {/* */}
12 |
13 |
14 |
15 | );
16 | };
17 | export default WorkSpace;
18 |
--------------------------------------------------------------------------------
/web/src/pages/WorkSpace/index.less:
--------------------------------------------------------------------------------
1 | .user-prolist {
2 | .ant-list-split {
3 | // overflow-y: auto;
4 | display: flex !important;
5 | flex-direction: column !important;
6 | height: calc(100vh - 160px) !important;
7 | .ant-spin-nested-loading {
8 | flex: 1 !important;
9 | overflow-y: auto !important;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/web/src/pages/WorkSpace/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 |
5 | import { Footer } from '@/components';
6 | import RunWorkFlow from '@/components/WorkFlow/RunWorkFlow';
7 | import React from 'react';
8 | import Backlogs from './components/Backlogs';
9 | import RecentlyActive from './components/RecentlyActive';
10 | import WorkFlowLog from './components/WorkFlowLog';
11 | import './index.less';
12 | const WorkSpace: React.FC = () => {
13 | return (
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 | };
28 |
29 | export default WorkSpace;
30 |
--------------------------------------------------------------------------------
/web/src/py2js/nodes/test.js:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 |
5 | class Test {
6 | constructor() {
7 | this.a = 1;
8 | this.b = 2;
9 | this.c = 3;
10 | }
11 | test() {
12 | return this.a + this.b + this.c;
13 | }
14 | }
15 | export default Test;
16 |
--------------------------------------------------------------------------------
/web/src/services/ant-design-pro/api.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/services/ant-design-pro/api.ts
--------------------------------------------------------------------------------
/web/src/services/ant-design-pro/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/services/ant-design-pro/index.ts
--------------------------------------------------------------------------------
/web/src/services/ant-design-pro/login.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/services/ant-design-pro/login.ts
--------------------------------------------------------------------------------
/web/src/services/ant-design-pro/typings.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/services/ant-design-pro/typings.d.ts
--------------------------------------------------------------------------------
/web/src/services/swagger/index.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | // @ts-ignore
5 | /* eslint-disable */
6 |
7 | export default {
8 |
9 | };
10 |
--------------------------------------------------------------------------------
/web/src/store/createSelectors.ts:
--------------------------------------------------------------------------------
1 | import { StoreApi, UseBoundStore } from 'zustand';
2 |
3 | type WithSelectors = S extends { getState: () => infer T }
4 | ? S & { use: { [K in keyof T]: () => T[K] } }
5 | : never;
6 |
7 | export const createSelectors = >>(_store: S) => {
8 | let store = _store as WithSelectors;
9 | store.use = {};
10 | for (let k of Object.keys(store.getState())) {
11 | (store.use as any)[k] = () => store(s => s[k as keyof typeof s]);
12 | }
13 |
14 | return store;
15 | };
16 |
--------------------------------------------------------------------------------
/web/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'slash2';
2 | declare module '*.css';
3 | declare module '*.less';
4 | declare module '*.scss';
5 | declare module '*.sass';
6 | declare module '*.svg';
7 | declare module '*.png';
8 | declare module '*.jpg';
9 | declare module '*.jpeg';
10 | declare module '*.gif';
11 | declare module '*.bmp';
12 | declare module '*.tiff';
13 | declare module 'omit.js';
14 | declare module 'numeral';
15 | declare module '@antv/data-set';
16 | declare module 'mockjs';
17 | declare module 'react-fittext';
18 | declare module 'bizcharts-plugin-slider';
19 |
20 | declare const REACT_APP_ENV: 'test' | 'dev' | 'pre' | false;
21 |
--------------------------------------------------------------------------------
/web/src/utils/upload.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/src/utils/upload.ts
--------------------------------------------------------------------------------
/web/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /*
2 | * @LastEditors: biz
3 | */
4 | /** @type {import('tailwindcss').Config} */
5 | module.exports = {
6 | content: ['./src/**/*.{js,jsx,ts,tsx}'],
7 | theme: {
8 | extend: {
9 | animation: {
10 | 'fade-in': 'fadeIn 1s ease-in-out',
11 | },
12 | keyframes: {
13 | fadeIn: {
14 | '0%': { opacity: 0 },
15 | '100%': { opacity: 1 },
16 | },
17 | },
18 | },
19 | },
20 | plugins: [],
21 | };
22 |
--------------------------------------------------------------------------------
/web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "declaration": true,
6 | "outDir": "./dist",
7 | "moduleResolution": "node",
8 | "importHelpers": true,
9 | "jsx": "preserve",
10 | "esModuleInterop": true,
11 | "sourceMap": true,
12 | "baseUrl": "./",
13 | "skipLibCheck": true,
14 | "experimentalDecorators": true,
15 | "strict": false,
16 | "resolveJsonModule": true,
17 | "allowSyntheticDefaultImports": true,
18 | "paths": {
19 | "@/*": ["./src/*"],
20 | "@@/*": ["./src/.umi/*"],
21 | "@@test/*": ["./src/.umi-test/*"]
22 | }
23 | },
24 | "include": ["./**/*.d.ts", "./**/*.ts", "./**/*.tsx", "src"]
25 | }
26 |
--------------------------------------------------------------------------------
/web/types/index.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EDEAI/NexusAI/a4c45e904bee6057a42206af88787a2cc8264025/web/types/index.d.ts
--------------------------------------------------------------------------------
/web/typings.d.ts:
--------------------------------------------------------------------------------
1 | declare const API_URL: string;
2 | declare const WS_URL: string;
3 | declare const CHAT_URL: string;
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/websocket.py:
--------------------------------------------------------------------------------
1 | import uvicorn
2 | import asyncio
3 | from fastapi import FastAPI
4 | from fastapi.middleware.cors import CORSMiddleware
5 | from config import settings
6 | from core.websocket.websocket_manager import websocket_router
7 | from core.websocket.websocket_queue_pop import queue_processor
8 |
9 | app = FastAPI(
10 | title="NexusAI WebSocket Server",
11 | description="WebSocket server for handling real-time connections.",
12 | version="1.0.0"
13 | )
14 |
15 | app.add_middleware(
16 | CORSMiddleware,
17 | allow_origins=["*"],
18 | allow_credentials=True,
19 | allow_methods=["*"],
20 | allow_headers=["*"],
21 | )
22 |
23 | app.include_router(websocket_router())
24 |
25 | def start_queue_processor():
26 | asyncio.create_task(queue_processor())
27 |
28 | app.add_event_handler("startup", start_queue_processor)
29 |
30 | if __name__ == "__main__":
31 | uvicorn.run("websocket:app", host="0.0.0.0", port=settings.WEBSOCKET_PORT)
32 |
--------------------------------------------------------------------------------