diff --git a/frontend/src/components/flow/PipelineFlowEditor.tsx b/frontend/src/components/flow/PipelineFlowEditor.tsx index 9a97683..6deed4a 100644 --- a/frontend/src/components/flow/PipelineFlowEditor.tsx +++ b/frontend/src/components/flow/PipelineFlowEditor.tsx @@ -67,6 +67,7 @@ function FlowEditorInner({ pipelineId, saveSignal = 0, runSignal = 0 }: FlowEdit const [edges, setEdges, onEdgesChange] = useEdgesState([]); const [catalogOpen, setCatalogOpen] = useState(true); const [selectedCategory, setSelectedCategory] = useState('all'); + const [taskSearch, setTaskSearch] = useState(''); const [selectedNode, setSelectedNode] = useState | null>(null); const [isRunning, setIsRunning] = useState(false); const [logOpen, setLogOpen] = useState(false); @@ -255,9 +256,16 @@ function FlowEditorInner({ pipelineId, saveSignal = 0, runSignal = 0 }: FlowEdit setNodes((nds) => [...nds, newNode]); }, [nodes.length, setNodes]); - const filteredTasks = selectedCategory === 'all' - ? catalogTasks - : catalogTasks.filter((t) => t.category === selectedCategory); + const filteredTasks = catalogTasks.filter((t) => { + if (selectedCategory !== 'all' && t.category !== selectedCategory) return false; + if (!taskSearch.trim()) return true; + const q = taskSearch.trim().toLowerCase(); + return ( + t.name.toLowerCase().includes(q) || + t.description.toLowerCase().includes(q) || + t.params.some((p) => p.name.toLowerCase().includes(q)) + ); + }); return (
@@ -269,6 +277,15 @@ function FlowEditorInner({ pipelineId, saveSignal = 0, runSignal = 0 }: FlowEdit Task 任务库 Tekton
+
+ setTaskSearch(e.target.value)} + placeholder="搜索任务/参数…" + className="w-full px-2 py-[5px] text-[11px] rounded-md border outline-none" + style={{ background: 'var(--panel-bg-secondary)', borderColor: 'var(--border-color-light)', color: 'var(--text-primary)' }} + /> +