diff --git a/backend/services/node_specs.py b/backend/services/node_specs.py index fa7c359..3ad9da2 100644 --- a/backend/services/node_specs.py +++ b/backend/services/node_specs.py @@ -56,7 +56,7 @@ NODE_SPECS: list[dict[str, Any]] = [ "description": "终止节点,礼貌结束对话。可有多个,均无出边。", "icon": "Flag", "accent": "rose", - "addable": False, + "addable": True, "constraints": {"minIncoming": 1, "minOutgoing": 0, "maxOutgoing": 0}, "fields": [ {"key": "name", "label": "节点名称", "type": "text"}, diff --git a/frontend/src/components/workflow/GenericNode.tsx b/frontend/src/components/workflow/GenericNode.tsx index 9a562d1..f65e374 100644 --- a/frontend/src/components/workflow/GenericNode.tsx +++ b/frontend/src/components/workflow/GenericNode.tsx @@ -6,7 +6,7 @@ */ import { Handle, Position, type NodeProps } from "@xyflow/react"; -import { Pencil, Trash2 } from "lucide-react"; +import { MessageSquareText, Pencil, Trash2 } from "lucide-react"; import { useContext } from "react"; import { cn } from "@/lib/utils"; @@ -35,22 +35,30 @@ export function GenericNode({ id, type, data, selected }: NodeProps) {
{spec.hasTarget && ( )} +
+ {isActive && (
@@ -78,7 +86,7 @@ export function GenericNode({ id, type, data, selected }: NodeProps) { > - {spec.addable && ( + {type !== "startCall" && ( - - - + + { + setEditingId(null); + setEditingEdgeId(null); + }} + fitView + proOptions={{ hideAttribution: true }} + defaultEdgeOptions={{ type: "condition", animated: true }} + > + + + + + + + + + {/* 添加节点弹窗 */} - - - - 添加节点 - - - 选择要添加到画布的节点类型。 - + + +
+
+
+ +
+
+
+ 节点目录 +
+ + 添加节点 + + + 选择节点类型并添加到画布中央,随后可编辑内容并建立连线。 + +
+
-
- {addableSpecs.length === 0 && ( -

暂无可添加的节点类型。

- )} +
+ {addableSpecs.length === 0 ? ( +

+ 暂无可添加的节点类型。 +

+ ) : null} {addableSpecs.map((spec) => { const Icon = spec.icon; return ( ); })} @@ -358,16 +429,34 @@ function Canvas({ {/* 工作流设置弹窗 */} - - - - 工作流设置 - - - 配置整个工作流使用的语音与大模型,以及交互策略。 - + + +
+
+
+ +
+
+
+ 全局配置 +
+ + 工作流设置 + + + 配置整个工作流使用的语音、大模型与交互策略。 + +
+
-
+
onSettingsChange({ ...settings, tts: v })} /> -
- + @@ -420,7 +514,7 @@ function Canvas({ setEditingId(null); }} onDelete={ - editingSpec.addable + editingNode.type !== "startCall" ? () => deleteNode(editingNode.id) : undefined } @@ -468,13 +562,13 @@ function ModelSelect({ onChange: (value: string | undefined) => void; }) { return ( -
+