feat(web): 增加表单数据校验
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import {useState} from 'react'
|
||||
import FlowEditor, {type GraphData} from '../components/flow/FlowEditor.tsx'
|
||||
import FlowEditor from '../components/flow/FlowEditor.tsx'
|
||||
import type {GraphData} from '../components/flow/types.ts'
|
||||
|
||||
function Test() {
|
||||
const [graphData] = useState<GraphData>({
|
||||
nodes: [],
|
||||
edges: [],
|
||||
data: {},
|
||||
})
|
||||
// language=JSON
|
||||
const [graphData] = useState<GraphData>(JSON.parse('{\n "nodes": [\n {\n "id": "MzEitlOusl",\n "type": "llm-node",\n "position": {\n "x": 47,\n "y": 92\n },\n "data": {},\n "measured": {\n "width": 256,\n "height": 130\n },\n "selected": false,\n "dragging": false\n },\n {\n "id": "bivXSpiLaI",\n "type": "code-node",\n "position": {\n "x": 381,\n "y": 181\n },\n "data": {},\n "measured": {\n "width": 256,\n "height": 130\n },\n "selected": true,\n "dragging": false\n }\n ],\n "edges": [\n {\n "source": "MzEitlOusl",\n "sourceHandle": "source",\n "target": "bivXSpiLaI",\n "targetHandle": "target",\n "id": "xy-edge__MzEitlOuslsource-bivXSpiLaItarget"\n }\n ],\n "data": {\n "MzEitlOusl": {\n "node": {\n "name": "大模型",\n "description": "使用大模型对话"\n },\n "outputs": {\n "text": {\n "type": "string"\n }\n },\n "model": "qwen3",\n "systemPrompt": "你是个好人",\n "finished": true\n },\n "bivXSpiLaI": {\n "node": {\n "name": "代码执行",\n "description": "执行自定义的处理代码"\n },\n "outputs": {\n "result": {\n "type": "string"\n }\n },\n "type": "javascript",\n "content": "console.log(\'hello\')",\n "inputs": {\n "text": {\n "variable": "MzEitlOusl.text"\n }\n },\n "finished": true\n }\n }\n}'))
|
||||
|
||||
return (
|
||||
<div className="h-screen">
|
||||
|
||||
Reference in New Issue
Block a user