-
{t('workflow.nodeProperties')}
+
+
{t('workflow.nodeProperties')}
{!selectedNode
?
- :
= ({
if (selectedNode?.data?.type === 'start' && key === 'variables' && config.type === 'define') {
return (
-
-
-
- {t(`workflow.config.${selectedNode?.data?.type}.${key}`)}
-
-
-
-
-
- {Array.isArray(config.defaultValue) && config.defaultValue?.map((vo, index) =>
-
-
{vo.name}·{vo.description}
-
-
- {vo.required && {t('workflow.config.start.required')}}
- {vo.type}
-
-
- handleEditVariable(index, vo)}
- >
- handleDeleteVariable(index, vo)}
- >
-
-
- )}
-
- {config.sys?.map((vo, index) =>
-
-
- sys.{vo.name}
-
- {vo.type}
-
- )}
-
-
+
+
+
)
}
@@ -1143,23 +1068,12 @@ const Properties: FC = ({
key={key}
options={contextVariableList.filter(variable => variable.nodeData?.type !== 'knowledge-retrieval')}
parentName={key}
+ placeholder={t(config.placeholder || 'common.pleaseSelect')}
+ size="small"
/>
)
}
- if (selectedNode?.data?.type === 'end' && key === 'output') {
- return (
-
- variable.nodeData?.type !== 'knowledge-retrieval')}
- />
-
- )
- }
-
if (config.type === 'define') {
return null
}
@@ -1184,6 +1098,8 @@ const Properties: FC
= ({
parentName={key}
enableJinja2={config.enableJinja2 as boolean}
options={getFilteredVariableList(selectedNode?.data?.type, key)}
+ titleVariant={config.titleVariant}
+ size="small"
/>
)
@@ -1206,9 +1122,9 @@ const Properties: FC = ({
name={key}
options={getFilteredVariableList(selectedNode?.data?.type, key)}
isCanAdd={!!(values as any)?.group}
+ size="small"
/>
-
)
}
if (config.type === 'caseList') {
@@ -1226,9 +1142,7 @@ const Properties: FC = ({
if (config.type === 'mappingList') {
return (
-
+
@@ -1238,6 +1152,7 @@ const Properties: FC = ({
return (
@@ -1276,87 +1191,14 @@ const Properties: FC = ({
)
}
-
- return (
-
- {config.type === 'input'
- ?
- : config.type === 'textarea'
- ?
- : config.type === 'select'
- ?
+ )
+ }
+
+ return (
+ {t(`workflow.config.${selectedNode?.data?.type}.${key}`)} : t(`workflow.config.${selectedNode?.data?.type}.${key}`)}
+ layout={config.type === 'switch' ? 'horizontal' : 'vertical'}
+ className={key === 'parallel_count' ? 'rb:-mt-3! rb:leading-3.5!' : ''}
+ >
+ {config.type === 'input'
+ ?
+ : config.type === 'textarea'
+ ?
+ : config.type === 'select'
+ ?
@@ -1383,11 +1312,6 @@ const Properties: FC = ({
}
}
-
-
);
};
diff --git a/web/src/views/Workflow/components/Properties/properties.module.css b/web/src/views/Workflow/components/Properties/properties.module.css
new file mode 100644
index 00000000..292a13e4
--- /dev/null
+++ b/web/src/views/Workflow/components/Properties/properties.module.css
@@ -0,0 +1,90 @@
+.properties :global(.ant-input-outlined),
+.properties :global(.ant-input-number-outlined),
+.properties :global(.ant-select-outlined:not(.ant-select-customize-input) .ant-select-selector),
+.properties :global(.ant-input-number-outlined),
+.properties :global(.ant-input-number-outlined .ant-input-number-handler-wrap) {
+ background-color: transparent;
+}
+.properties :global(.ant-input-outlined.ant-input-disabled),
+.properties :global(.ant-input-outlined[disabled]) {
+ background-color: #F6F8FC;
+}
+.properties :global(.ant-select-single.ant-select-sm){
+ height: 28px;
+}
+.properties :global(.ant-table-wrapper .ant-table-thead>tr>th),
+.properties :global(.ant-table-wrapper .ant-table-thead>tr>td),
+.properties :global(.ant-table-wrapper .ant-table) {
+ background-color: #F6F8FC;
+}
+.properties :global(.ant-table-wrapper .ant-table),
+.properties :global(.ant-table-container),
+.properties :global(.ant-table-wrapper table) {
+ border-radius: 6px;
+}
+.properties :global(.ant-table-wrapper .ant-table-container table>thead>tr:first-child>*:first-child) {
+ border-start-start-radius: 6px;
+}
+.properties :global(.ant-table-wrapper .ant-table-container table>thead>tr:first-child>*:last-child) {
+ border-start-end-radius: 6px;
+}
+.properties :global(.ant-table-row:last-child .ant-table-cell:first-child) {
+ border-bottom-left-radius: 6px;
+}
+.properties :global(.ant-table-row:last-child .ant-table-cell:last-child) {
+ border-bottom-right-radius: 6px;
+}
+.properties :global(.ant-table-wrapper .ant-table) {
+ background: transparent;
+}
+.properties :global(.ant-table-wrapper .ant-table-container) {
+ border-start-start-radius: 6px;
+ border-start-end-radius: 6px;
+}
+.properties :global(.ant-table-container) {
+ /* border-left: none;
+ border-top: none;
+ border-bottom: none; */
+ border: none;
+}
+.properties :global(.ant-table-wrapper .ant-table-tbody>tr.ant-table-placeholder:hover>th),
+.properties :global(.ant-table-wrapper .ant-table-tbody>tr.ant-table-placeholder:hover>td),
+.properties :global(.ant-table-wrapper .ant-table-tbody>tr.ant-table-placeholder),
+.properties :global(.ant-table-wrapper .ant-table) {
+ background-color: #F6F8FC;
+}
+.properties :global(.ant-form-item-horizontal.ant-form-item .ant-form-item-control-input-content:has(> .ant-switch:only-child, > .ant-rate:only-child)) {
+ display: flex;
+ justify-content: end;
+}
+.properties :global(.ant-divider-horizontal.ant-divider-sm) {
+ margin-block: 16px;
+}
+.properties :global(.ant-form-item) {
+ margin-bottom: 16px;
+}
+.properties :global(.ant-form-item .ant-form-item-label>label) {
+ font-weight: 500;
+ font-size: 12px;
+}
+.properties :global(.ant-select-single.ant-select-sm .ant-select-selector),
+.properties :global(.ant-select-dropdown .ant-select-item),.properties :global(.ant-input-number-sm) {
+ font-size: 12px;
+}
+.properties :global(.ant-input-number-out-of-range .ant-input-number-input-wrap input) {
+ color: #212332;
+}
+.properties :global(.ant-slider-horizontal .ant-slider-step) {
+ height: 6px;
+}
+.properties :global(.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector) {
+ padding: 0 4px 0 6px ;
+}
+.properties :global(.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item),
+.properties :global(.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder) {
+ padding-right: 10px;
+}
+.properties :global(.ant-select .ant-select-arrow) {
+ font-size: 10px;
+ inset-inline-end: 6px;
+}
\ No newline at end of file
diff --git a/web/src/views/Workflow/constant.ts b/web/src/views/Workflow/constant.ts
index 78f0d1b6..bea518bf 100644
--- a/web/src/views/Workflow/constant.ts
+++ b/web/src/views/Workflow/constant.ts
@@ -90,7 +90,7 @@ export const nodeLibrary: NodeLibrary[] = [
type: "end", icon: endIcon,
config: {
output: {
- type: 'define'
+ type: 'editor'
}
}
},
@@ -125,6 +125,7 @@ export const nodeLibrary: NodeLibrary[] = [
},
context: {
type: 'variableList',
+ placeholder: 'workflow.config.llm.contextPlaceholder'
},
messages: {
type: 'define',
@@ -134,7 +135,8 @@ export const nodeLibrary: NodeLibrary[] = [
content: undefined,
readonly: true
},
- ]
+ ],
+ placeholder: 'workflow.config.llm.messagesPlaceholder'
},
memory: {
type: 'memoryConfig',
@@ -170,7 +172,8 @@ export const nodeLibrary: NodeLibrary[] = [
},
text: {
type: 'variableList',
- filterLoopIterationVars: true
+ filterLoopIterationVars: true,
+ placeholder: 'workflow.config.parameter-extractor.textPlaceholder'
},
params: {
type: 'paramList',
@@ -178,6 +181,8 @@ export const nodeLibrary: NodeLibrary[] = [
prompt: {
type: 'messageEditor',
isArray: false,
+ titleVariant: 'borderless',
+ placeholder: 'workflow.config.parameter-extractor.promptPlaceholder'
},
}
}
@@ -189,7 +194,7 @@ export const nodeLibrary: NodeLibrary[] = [
{ type: "memory-read", icon: memoryReadIcon,
config: {
message: {
- type: 'messageEditor',
+ type: 'editor',
isArray: false
},
config_id: {
@@ -212,7 +217,7 @@ export const nodeLibrary: NodeLibrary[] = [
{ type: "memory-write", icon: memoryWriteIcon,
config: {
message: {
- type: 'messageEditor',
+ type: 'editor',
isArray: false
},
config_id: {
@@ -270,7 +275,8 @@ export const nodeLibrary: NodeLibrary[] = [
},
user_supplement_prompt: {
type: 'messageEditor',
- isArray: false
+ isArray: false,
+ titleVariant: 'borderless'
}
}
},
@@ -436,6 +442,7 @@ export const nodeLibrary: NodeLibrary[] = [
type: 'messageEditor',
isArray: false,
enableJinja2: true,
+ titleVariant: 'borderless',
defaultValue: "{{arg1}}"
},
}
diff --git a/web/src/views/Workflow/types.ts b/web/src/views/Workflow/types.ts
index 9d25ccf7..909c30e4 100644
--- a/web/src/views/Workflow/types.ts
+++ b/web/src/views/Workflow/types.ts
@@ -1,8 +1,11 @@
import { Graph } from '@antv/x6';
import type { KnowledgeConfig } from './components/Properties/Knowledge/types'
+import type { Variable } from './components/Properties/VariableList/types'
export interface NodeConfig {
type: 'input' | 'textarea' | 'select' | 'inputNumber' | 'slider' | 'customSelect' | 'define' | 'knowledge' | 'variableList' | string;
+ placeholder?: string;
+ titleVariant?: 'outlined' | 'borderless';
options?: { label: string; value: string }[];
max?: number;
@@ -14,7 +17,7 @@ export interface NodeConfig {
valueKey?: string;
labelKey?: string;
- defaultValue?: any | StartVariableItem[];
+ defaultValue?: any;
sys?: Array<{
name: string;
@@ -37,6 +40,7 @@ export interface NodeProperties {
id?: string;
config?: Record
;
hidden?: boolean;
+ cycle?: string;
}
export interface NodeLibrary {
@@ -87,27 +91,12 @@ export interface WorkflowConfig {
updated_at: number;
}
-export interface VariableEditModalRef {
- handleOpen: (values?: StartVariableItem) => void;
-}
-export interface StartVariableItem {
- name: string;
- type: string;
- required: boolean;
- description: string;
- max_length?: number;
- default?: string;
- readonly?: boolean;
- defaultValue?: any;
- value?: any;
-}
-
export interface ChatRef {
handleOpen: () => void;
}
export type GraphRef = React.MutableRefObject
export interface VariableConfigModalRef {
- handleOpen: (values: StartVariableItem[]) => void;
+ handleOpen: (values: Variable[]) => void;
}
export interface ChatVariable {