+ {compact ? null :
}
onChange({
...branch,
condition: { ...condition, right: event.target.value },
@@ -428,6 +465,33 @@ function ConditionFields({
)
}
+function ConfigCard({
+ title,
+ meta,
+ action,
+ children,
+}: {
+ title: string
+ meta?: string
+ action?: ReactNode
+ children: ReactNode
+}) {
+ return (
+
+
+
+
+ {meta ? {meta} : null}
+ {action}
+
+
+ {children}
+
+ )
+}
+
function buildTargetOptions(nodes: AIWorkflowDefinition["nodes"], currentNodeId: string) {
return nodes
.filter((node) => node.id !== currentNodeId && node.type !== "start")
diff --git a/web/app/dashboard/ai-workflows/_components/variable-selector.tsx b/web/app/dashboard/ai-workflows/_components/variable-selector.tsx
index 64d3cf2..02acc35 100644
--- a/web/app/dashboard/ai-workflows/_components/variable-selector.tsx
+++ b/web/app/dashboard/ai-workflows/_components/variable-selector.tsx
@@ -15,11 +15,13 @@ export function VariableSelector({
variables,
onChange,
placeholder = "选择变量",
+ triggerClassName,
}: {
value?: WorkflowVariableSelector
variables: WorkflowVariableRef[]
onChange: (value: WorkflowVariableSelector) => void
placeholder?: string
+ triggerClassName?: string
}) {
const selected = value ? `${refNodeId(value)}.${refField(value)}` : ""
const options = variables.map((variable) => ({
@@ -33,6 +35,7 @@ export function VariableSelector({
value={selected}
options={options}
placeholder={placeholder}
+ triggerClassName={triggerClassName}
onChange={(next) => {
const variable = variables.find((item) => `${item.nodeId}.${item.field}` === next)
if (variable) {
diff --git a/web/app/dashboard/ai-workflows/_components/workflow-config-sidebar.tsx b/web/app/dashboard/ai-workflows/_components/workflow-config-sidebar.tsx
index 9f09011..fad2856 100644
--- a/web/app/dashboard/ai-workflows/_components/workflow-config-sidebar.tsx
+++ b/web/app/dashboard/ai-workflows/_components/workflow-config-sidebar.tsx
@@ -7,6 +7,7 @@ import type { AIWorkflowDefinition, AIWorkflowNodeSpec } from "@/lib/api/admin"
import type { SelectedWorkflowBranch } from "./workflow-branch-selection"
import { ConditionBranchConfigPanel, NodeConfigPanel } from "./node-config-panel"
+import { WorkflowNodeIcon } from "./workflow-node-icon"
import {
getAvailableVariables,
normalizeNodeConfig,
@@ -49,6 +50,7 @@ export function WorkflowConfigPanel({
const panelDescription = selectedBranchItem
? "配置该条件分支的匹配规则和目标节点。"
: selectedNodeSpec?.description || ""
+ const panelIcon = selectedBranchItem ? "GitBranchIcon" : selectedNodeSpec?.icon
if (!selectedNode) {
return null
@@ -67,30 +69,52 @@ export function WorkflowConfigPanel({
}
return (
-
-
-
-
-
{panelTitle}
+
+
+
+
+
+
+
+
+
+ {panelTitle}
+
+ {panelDescription ? (
+
+ {panelDescription}
+
+ ) : null}
+
+
+
+
{panelMeta ? (
-
{panelMeta}
- ) : null}
- {panelDescription ? (
-
- {panelDescription}
+
+
+
+ {panelMeta}
+
+
+ 可配置
+
+
) : null}
-
{selectedBranchItem && selectedBranch ? (
@@ -109,7 +133,6 @@ export function WorkflowConfigPanel({
nodes={definition.nodes}
availableVariables={availableVariables}
showHeader={false}
- showConditionBranches={selectedNode.type !== "condition"}
onChange={onChangeNodeData}
onDelete={onDeleteNode}
/>
diff --git a/web/components/option-combobox.tsx b/web/components/option-combobox.tsx
index a8b7631..d5a019b 100644
--- a/web/components/option-combobox.tsx
+++ b/web/components/option-combobox.tsx
@@ -33,6 +33,7 @@ type OptionComboboxProps = {
searchPlaceholder?: string
emptyText?: string
disabled?: boolean
+ triggerClassName?: string
onChange: (value: string) => void
renderOptionAction?: (option: ComboboxOption) => ReactNode
}
@@ -44,6 +45,7 @@ export function OptionCombobox({
searchPlaceholder,
emptyText,
disabled = false,
+ triggerClassName,
onChange,
renderOptionAction,
}: OptionComboboxProps) {
@@ -59,7 +61,7 @@ export function OptionCombobox({
}