From 29720b7360b82c2ff549bd0369be2f9c857e0142 Mon Sep 17 00:00:00 2001 From: Wu Tianwei <30284043+WTW0313@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:53:50 +0800 Subject: [PATCH 001/211] fix: adjust spacing in ViewHistory and Panel components (#17766) --- web/app/components/workflow/header/view-history.tsx | 2 +- web/app/components/workflow/nodes/variable-assigner/panel.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/header/view-history.tsx b/web/app/components/workflow/header/view-history.tsx index 48053c8336..e56731952c 100644 --- a/web/app/components/workflow/header/view-history.tsx +++ b/web/app/components/workflow/header/view-history.tsx @@ -199,7 +199,7 @@ const ViewHistory = ({ item.id === historyWorkflowData?.id && 'text-primary-600', )} > - {`Test ${isChatMode ? 'Chat' : 'Run'}#${item.sequence_number}`} + {`Test ${isChatMode ? 'Chat' : 'Run'} #${item.sequence_number}`}
{item.created_by_account?.name} · {formatTimeFromNow((item.finished_at || item.created_at) * 1000)} diff --git a/web/app/components/workflow/nodes/variable-assigner/panel.tsx b/web/app/components/workflow/nodes/variable-assigner/panel.tsx index 57ecfbb1ce..1655c21b1f 100644 --- a/web/app/components/workflow/nodes/variable-assigner/panel.tsx +++ b/web/app/components/workflow/nodes/variable-assigner/panel.tsx @@ -99,7 +99,7 @@ const Panel: FC> = ({ {isEnableGroup && ( <> -
+
<> {inputs.advanced_settings?.groups.map((item, index) => ( From 636a0ba37f703b8c9acc5b39e1e0941a3aa60d3e Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Thu, 10 Apr 2025 17:12:48 +0800 Subject: [PATCH 002/211] chore: skip document segments fetching with non-existed dataset of DatasetDocument in add_document_to_index_task task (#17784) --- api/tasks/add_document_to_index_task.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/tasks/add_document_to_index_task.py b/api/tasks/add_document_to_index_task.py index 0b7d2ad31f..be88881efc 100644 --- a/api/tasks/add_document_to_index_task.py +++ b/api/tasks/add_document_to_index_task.py @@ -37,6 +37,10 @@ def add_document_to_index_task(dataset_document_id: str): indexing_cache_key = "document_{}_indexing".format(dataset_document.id) try: + dataset = dataset_document.dataset + if not dataset: + raise Exception(f"Document {dataset_document.id} dataset {dataset_document.dataset_id} doesn't exist.") + segments = ( db.session.query(DocumentSegment) .filter( @@ -77,11 +81,6 @@ def add_document_to_index_task(dataset_document_id: str): document.children = child_documents documents.append(document) - dataset = dataset_document.dataset - - if not dataset: - raise Exception("Document has no dataset") - index_type = dataset.doc_form index_processor = IndexProcessorFactory(index_type).init_index_processor() index_processor.load(dataset, documents) From 17a26da1e60221dfaef5b934b0f0e8baf879cdd7 Mon Sep 17 00:00:00 2001 From: KVOJJJin Date: Thu, 10 Apr 2025 17:15:48 +0800 Subject: [PATCH 003/211] Feat: workflow dark mode (#17785) --- .../config-var/config-select/index.tsx | 45 ++++++++++-------- .../config-var/config-select/style.module.css | 21 --------- web/app/components/base/tag-input/index.tsx | 2 +- .../model-parameter-modal/trigger.tsx | 2 +- .../workflow/block-selector/index.tsx | 2 +- .../components/workflow/header/checklist.tsx | 26 +++++------ .../workflow/header/view-history.tsx | 26 +++++------ .../_base/components/add-variable-popup.tsx | 4 +- .../components/before-run-form/index.tsx | 16 +++---- .../components/editor/code-editor/index.tsx | 46 ++++--------------- .../components/editor/code-editor/style.css | 11 +++++ .../error-handle/fail-branch-card.tsx | 2 +- .../components/input-support-select-var.tsx | 2 +- .../nodes/_base/components/memory-config.tsx | 8 ++-- .../nodes/_base/components/output-vars.tsx | 2 +- .../panel-operator/change-block.tsx | 2 +- .../panel-operator/panel-operator-popup.tsx | 28 +++++------ .../nodes/_base/components/prompt/editor.tsx | 17 ++++--- .../readonly-input-with-select-var.tsx | 10 ++-- .../nodes/_base/components/remove-button.tsx | 12 ++--- .../_base/components/retry/retry-on-panel.tsx | 4 +- .../nodes/_base/components/selector.tsx | 10 ++-- .../components/title-description-input.tsx | 6 +-- .../nodes/_base/components/variable-tag.tsx | 4 +- .../_base/components/variable/var-list.tsx | 5 +- .../variable/var-reference-picker.tsx | 16 +++---- .../variable/var-reference-popup.tsx | 2 +- .../components/variable/var-type-picker.tsx | 10 ++-- .../nodes/_base/hooks/use-toggle-expend.ts | 4 +- .../components/workflow/nodes/_base/panel.tsx | 10 ++-- .../components/workflow/nodes/end/node.tsx | 16 +++---- .../nodes/http/components/api-input.tsx | 8 ++-- .../http/components/authorization/index.tsx | 6 +-- .../components/authorization/radio-group.tsx | 7 +-- .../nodes/http/components/curl-panel.tsx | 5 +- .../nodes/http/components/edit-body/index.tsx | 2 +- .../key-value/key-value-edit/input-item.tsx | 8 ++-- .../key-value/key-value-edit/item.tsx | 6 +-- .../nodes/http/components/timeout/index.tsx | 4 +- .../components/workflow/nodes/http/node.tsx | 5 +- .../components/workflow/nodes/http/panel.tsx | 14 +++--- .../workflow/nodes/iteration-start/index.tsx | 2 +- .../components/dataset-item.tsx | 2 +- .../components/dataset-list.tsx | 2 +- .../components/retrieval-config.tsx | 2 +- .../nodes/knowledge-retrieval/panel.tsx | 2 +- .../components/extract-input.tsx | 2 +- .../llm/components/config-prompt-item.tsx | 6 +-- .../nodes/llm/components/config-prompt.tsx | 2 +- .../llm/components/resolution-picker.tsx | 2 +- .../components/workflow/nodes/llm/panel.tsx | 8 ++-- .../workflow/nodes/loop-start/index.tsx | 4 +- .../workflow/nodes/loop/add-block.tsx | 6 +-- .../components/workflow/nodes/loop/node.tsx | 4 +- .../extract-parameter/import-from-tool.tsx | 4 +- .../components/extract-parameter/item.tsx | 25 +++++----- .../components/extract-parameter/update.tsx | 4 +- .../nodes/parameter-extractor/panel.tsx | 2 +- .../nodes/start/components/var-item.tsx | 22 ++++----- .../nodes/start/components/var-list.tsx | 2 +- .../components/workflow/nodes/start/node.tsx | 10 ++-- .../components/workflow/nodes/start/panel.tsx | 16 +++---- .../nodes/template-transform/panel.tsx | 4 +- .../components/workflow/nodes/tool/node.tsx | 10 ++-- .../components/workflow/nodes/tool/panel.tsx | 4 +- .../components/add-variable/index.tsx | 6 +-- .../components/node-group-item.tsx | 12 ++--- .../components/node-variable-item.tsx | 8 ++-- .../components/var-group-item.tsx | 2 +- .../components/var-list/index.tsx | 1 - .../nodes/variable-assigner/panel.tsx | 30 ++++++------ .../workflow/panel/chat-record/index.tsx | 14 +++--- .../workflow/panel/chat-record/user-input.tsx | 8 ++-- .../panel/debug-and-preview/index.tsx | 4 +- .../workflow/panel/workflow-preview.tsx | 24 +++++----- 75 files changed, 324 insertions(+), 368 deletions(-) delete mode 100644 web/app/components/app/configuration/config-var/config-select/style.module.css diff --git a/web/app/components/app/configuration/config-var/config-select/index.tsx b/web/app/components/app/configuration/config-var/config-select/index.tsx index 0e4256c691..d2dc1662c1 100644 --- a/web/app/components/app/configuration/config-var/config-select/index.tsx +++ b/web/app/components/app/configuration/config-var/config-select/index.tsx @@ -1,12 +1,10 @@ 'use client' import type { FC } from 'react' -import React from 'react' +import React, { useState } from 'react' +import { RiAddLine, RiDeleteBinLine, RiDraggable } from '@remixicon/react' import { useTranslation } from 'react-i18next' -import { PlusIcon } from '@heroicons/react/24/outline' import { ReactSortable } from 'react-sortablejs' -import RemoveIcon from '../../base/icons/remove-icon' - -import s from './style.module.css' +import cn from '@/utils/classnames' export type Options = string[] export type IConfigSelectProps = { @@ -19,6 +17,8 @@ const ConfigSelect: FC = ({ onChange, }) => { const { t } = useTranslation() + const [focusID, setFocusID] = useState(null) + const [deletingID, setDeletingID] = useState(null) const optionList = options.map((content, index) => { return ({ @@ -40,12 +40,15 @@ const ConfigSelect: FC = ({ animation={150} > {options.map((o, index) => ( -
-
- - - -
+
+ = ({ return item })) }} - className={'h-9 w-full grow cursor-pointer border-0 bg-transparent pl-1.5 pr-8 text-sm leading-9 text-gray-900 focus:outline-none'} + className={'h-9 w-full grow cursor-pointer overflow-x-auto rounded-lg border-0 bg-transparent pl-1.5 pr-8 text-sm leading-9 text-text-secondary focus:outline-none'} + onFocus={() => setFocusID(index)} + onBlur={() => setFocusID(null)} /> - { onChange(options.filter((_, i) => index !== i)) }} - /> + onMouseEnter={() => setDeletingID(index)} + onMouseLeave={() => setDeletingID(null)} + > + +
))} @@ -75,9 +84,9 @@ const ConfigSelect: FC = ({
{ onChange([...options, '']) }} - className='flex h-9 cursor-pointer items-center gap-2 rounded-lg bg-gray-100 px-3 text-gray-400'> - -
{t('appDebug.variableConfig.addOption')}
+ className='mt-1 flex h-9 cursor-pointer items-center gap-2 rounded-lg bg-components-button-tertiary-bg px-3 text-components-button-tertiary-text hover:bg-components-button-tertiary-bg-hover'> + +
{t('appDebug.variableConfig.addOption')}
) diff --git a/web/app/components/app/configuration/config-var/config-select/style.module.css b/web/app/components/app/configuration/config-var/config-select/style.module.css deleted file mode 100644 index a09d19537d..0000000000 --- a/web/app/components/app/configuration/config-var/config-select/style.module.css +++ /dev/null @@ -1,21 +0,0 @@ -.inputWrap { - display: flex; - align-items: center; - border-radius: 8px; - border: 1px solid #EAECF0; - padding-left: 10px; - cursor: pointer; -} - -.deleteBtn { - display: none; - display: flex; -} - -.inputWrap:hover { - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); -} - -.inputWrap:hover .deleteBtn { - display: flex; -} \ No newline at end of file diff --git a/web/app/components/base/tag-input/index.tsx b/web/app/components/base/tag-input/index.tsx index f3df585d48..2be9c5ffc7 100644 --- a/web/app/components/base/tag-input/index.tsx +++ b/web/app/components/base/tag-input/index.tsx @@ -70,7 +70,7 @@ const TagInput: FC = ({ } return ( -
+
{ (items || []).map((item, index) => (
= ({ 'relative flex h-8 cursor-pointer items-center rounded-lg px-2', !isInWorkflow && 'border ring-inset hover:ring-[0.5px]', !isInWorkflow && (disabled ? 'border-text-warning bg-state-warning-hover ring-text-warning' : 'border-util-colors-indigo-indigo-600 bg-state-accent-hover ring-util-colors-indigo-indigo-600'), - isInWorkflow && 'border border-workflow-block-parma-bg bg-workflow-block-parma-bg pr-[30px] hover:border-gray-200', + isInWorkflow && 'border border-workflow-block-parma-bg bg-workflow-block-parma-bg pr-[30px] hover:border-components-input-border-active', )} > { diff --git a/web/app/components/workflow/block-selector/index.tsx b/web/app/components/workflow/block-selector/index.tsx index 263ae0c227..f0f57adefe 100644 --- a/web/app/components/workflow/block-selector/index.tsx +++ b/web/app/components/workflow/block-selector/index.tsx @@ -128,7 +128,7 @@ const NodeSelector: FC = ({ } -
+
e.stopPropagation()}> {activeTab === TabsEnum.Blocks && (
-
+
{t('workflow.panel.checklist')}{needWarningNodes.length ? `(${needWarningNodes.length})` : ''}
setOpen(false)} > - +
{ !!needWarningNodes.length && ( <> -
{t('workflow.panel.checklistTip')}
+
{t('workflow.panel.checklistTip')}
{ needWarningNodes.map(node => (
{ handleNodeSelect(node.id) setOpen(false) }} > -
+
-
+
{ node.unConnected && ( -
-
+
+
{t('workflow.common.needConnectTip')}
@@ -132,8 +132,8 @@ const WorkflowChecklist = ({ } { node.errorMessage && ( -
-
+
+
{node.errorMessage}
@@ -150,8 +150,8 @@ const WorkflowChecklist = ({ } { !needWarningNodes.length && ( -
- +
+ {t('workflow.panel.checklistResolved')}
) diff --git a/web/app/components/workflow/header/view-history.tsx b/web/app/components/workflow/header/view-history.tsx index e56731952c..1298c0e42d 100644 --- a/web/app/components/workflow/header/view-history.tsx +++ b/web/app/components/workflow/header/view-history.tsx @@ -87,9 +87,9 @@ const ViewHistory = ({ { withText && (
-
+
{t('workflow.common.runHistory')}
- +
{ @@ -149,8 +149,8 @@ const ViewHistory = ({ { !data?.data.length && (
- -
+ +
{t('workflow.common.notRunning')}
@@ -161,8 +161,8 @@ const ViewHistory = ({
{ workflowStore.setState({ @@ -195,13 +195,13 @@ const ViewHistory = ({
{`Test ${isChatMode ? 'Chat' : 'Run'} #${item.sequence_number}`}
-
+
{item.created_by_account?.name} · {formatTimeFromNow((item.finished_at || item.created_at) * 1000)}
diff --git a/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx b/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx index b442cf64a4..a7a3a89676 100644 --- a/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx +++ b/web/app/components/workflow/nodes/_base/components/add-variable-popup.tsx @@ -18,8 +18,8 @@ export const AddVariablePopup = ({ const { t } = useTranslation() return ( -
-
+
+
{t('workflow.nodes.variableAssigner.setAssignVariable')}
diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx index 6fa5264277..ef4ba15c5c 100644 --- a/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx @@ -139,18 +139,16 @@ const BeforeRunForm: FC = ({ onRun(submitData) }, [forms, onRun, t]) return ( -
-
+
+
-
+
{t(`${i18nPrefix}.testRun`)} {nodeName}
{ onHide() }}> - +
{ @@ -178,14 +176,14 @@ const BeforeRunForm: FC = ({
{isRunning && (
- +
)}
diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx index 8aacfba64b..5a4a35ff8a 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx @@ -8,6 +8,8 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' import { getFilesInLogs, } from '@/app/components/base/file-uploader/utils' +import { Theme } from '@/types/app' +import useTheme from '@/hooks/use-theme' import './style.css' import { noop } from 'lodash-es' @@ -43,15 +45,6 @@ export const languageMap = { [CodeLanguage.json]: 'json', } -const DEFAULT_THEME = { - base: 'vs', - inherit: true, - rules: [], - colors: { - 'editor.background': '#F2F4F7', // #00000000 transparent. But it will has a blue border - }, -} - const CodeEditor: FC = ({ value = '', placeholder = '', @@ -76,7 +69,7 @@ const CodeEditor: FC = ({ const [isMounted, setIsMounted] = React.useState(false) const minHeight = height || 200 const [editorContentHeight, setEditorContentHeight] = useState(56) - + const { theme: appTheme } = useTheme() const valueRef = useRef(value) useEffect(() => { valueRef.current = value @@ -114,27 +107,7 @@ const CodeEditor: FC = ({ setIsFocus(false) }) - monaco.editor.defineTheme('default-theme', DEFAULT_THEME) - - monaco.editor.defineTheme('blur-theme', { - base: 'vs', - inherit: true, - rules: [], - colors: { - 'editor.background': '#F2F4F7', - }, - }) - - monaco.editor.defineTheme('focus-theme', { - base: 'vs', - inherit: true, - rules: [], - colors: { - 'editor.background': '#ffffff', - }, - }) - - monaco.editor.setTheme('default-theme') // Fix: sometimes not load the default theme + monaco.editor.setTheme(appTheme === Theme.light ? 'light' : 'vs-dark') // Fix: sometimes not load the default theme onMount?.(editor, monaco) setIsMounted(true) @@ -151,12 +124,11 @@ const CodeEditor: FC = ({ } })() - const theme = (() => { - if (noWrapper) - return 'default-theme' - - return isFocus ? 'focus-theme' : 'blur-theme' - })() + const theme = useMemo(() => { + if (appTheme === Theme.light) + return 'light' + return 'vs-dark' + }, [appTheme]) const main = ( <> diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css b/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css index 3a6624267a..296ea0ab14 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css @@ -6,6 +6,17 @@ padding-left: 0; } +.monaco-editor { + background-color: transparent !important; + outline: none !important; +} +.monaco-editor .monaco-editor-background { + background-color: transparent !important; +} +.monaco-editor .margin { + background-color: transparent !important; +} + /* hide readonly tooltip */ .monaco-editor-overlaymessage { display: none !important; diff --git a/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx b/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx index ec5c9e67ca..05a6cb96af 100644 --- a/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx +++ b/web/app/components/workflow/nodes/_base/components/error-handle/fail-branch-card.tsx @@ -7,7 +7,7 @@ const FailBranchCard = () => { return (
-
+
diff --git a/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx b/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx index 33e13637d4..aab14bb6f9 100644 --- a/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx +++ b/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx @@ -113,7 +113,7 @@ const Editor: FC = ({ -
+
diff --git a/web/app/components/workflow/nodes/_base/components/memory-config.tsx b/web/app/components/workflow/nodes/_base/components/memory-config.tsx index 0ae6f2c92c..446fcfa8ae 100644 --- a/web/app/components/workflow/nodes/_base/components/memory-config.tsx +++ b/web/app/components/workflow/nodes/_base/components/memory-config.tsx @@ -32,12 +32,12 @@ const RoleItem: FC = ({ }, [onChange]) return (
-
{title}
- {title}
+
) @@ -180,7 +180,7 @@ const MemoryConfig: FC = ({
{canSetRoleName && (
-
{t(`${i18nPrefix}.conversationRoleName`)}
+
{t(`${i18nPrefix}.conversationRoleName`)}
= ({
{description} {subItems && ( -
+
{subItems.map((item, index) => ( { return ( -
+
{t('workflow.panel.changeBlock')}
) diff --git a/web/app/components/workflow/nodes/_base/components/panel-operator/panel-operator-popup.tsx b/web/app/components/workflow/nodes/_base/components/panel-operator/panel-operator-popup.tsx index 23150b3896..28d7358ddb 100644 --- a/web/app/components/workflow/nodes/_base/components/panel-operator/panel-operator-popup.tsx +++ b/web/app/components/workflow/nodes/_base/components/panel-operator/panel-operator-popup.tsx @@ -84,7 +84,7 @@ const PanelOperatorPopup = ({ const link = useNodeHelpLink(data.type) return ( -
+
{ (showChangeBlock || canRunBySingle(data.type)) && ( <> @@ -93,8 +93,8 @@ const PanelOperatorPopup = ({ canRunBySingle(data.type) && (
{ handleNodeSelect(id) @@ -117,7 +117,7 @@ const PanelOperatorPopup = ({ ) }
-
+
) } @@ -126,7 +126,7 @@ const PanelOperatorPopup = ({ <>
{ onClosePopup() handleNodesCopy(id) @@ -136,7 +136,7 @@ const PanelOperatorPopup = ({
{ onClosePopup() handleNodesDuplicate(id) @@ -146,12 +146,12 @@ const PanelOperatorPopup = ({
-
+
handleNodeDelete(id)} > @@ -159,7 +159,7 @@ const PanelOperatorPopup = ({
-
+
) } @@ -170,21 +170,21 @@ const PanelOperatorPopup = ({ {t('workflow.panel.helpLink')}
-
+
) }
-
+
{t('workflow.panel.about').toLocaleUpperCase()}
-
{about}
+
{about}
{t('workflow.panel.createdBy')} {author}
diff --git a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx index cc8799bbed..dd4d837d12 100644 --- a/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx +++ b/web/app/components/workflow/nodes/_base/components/prompt/editor.tsx @@ -26,7 +26,6 @@ import { Clipboard, ClipboardCheck, } from '@/app/components/base/icons/src/vender/line/files' -import s from '@/app/components/app/configuration/config-prompt/style.module.css' import { useEventEmitterContextContext } from '@/context/event-emitter' import { PROMPT_EDITOR_INSERT_QUICKLY } from '@/app/components/base/prompt-editor/plugins/update-block' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' @@ -147,20 +146,20 @@ const Editor: FC = ({ return ( -
-
+
+
-
{title} {required && *}
+
{title} {required && *}
{titleTooltip && }
-
{value?.length || 0}
+
{value?.length || 0}
{isSupportPromptGenerator && ( )} -
+
{/* Operations */}
{isSupportJinja && ( @@ -168,13 +167,13 @@ const Editor: FC = ({ popupContent={ } needsDelay > -
- +
+ = ({ return ( {str} -
+
{!isEnv && !isChatVar && (
-
{node?.title}
+
{node?.title}
)} -
+
{!isEnv && !isChatVar && } {isEnv && } {isChatVar && } -
{varName}
+
{varName}
) diff --git a/web/app/components/workflow/nodes/_base/components/remove-button.tsx b/web/app/components/workflow/nodes/_base/components/remove-button.tsx index 9fc9c166bb..62381f8c2a 100644 --- a/web/app/components/workflow/nodes/_base/components/remove-button.tsx +++ b/web/app/components/workflow/nodes/_base/components/remove-button.tsx @@ -2,7 +2,7 @@ import type { FC } from 'react' import React from 'react' import { RiDeleteBinLine } from '@remixicon/react' -import cn from '@/utils/classnames' +import ActionButton from '@/app/components/base/action-button' type Props = { className?: string @@ -10,16 +10,12 @@ type Props = { } const Remove: FC = ({ - className, onClick, }) => { return ( -
- -
+ + + ) } export default React.memo(Remove) diff --git a/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx b/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx index b07538a014..0e5b807ff4 100644 --- a/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx +++ b/web/app/components/workflow/nodes/_base/components/retry/retry-on-panel.tsx @@ -66,7 +66,7 @@ const RetryOnPanel = ({ retry_config?.retry_enabled && (
-
{t('workflow.nodes.common.retry.maxRetries')}
+
{t('workflow.nodes.common.retry.maxRetries')}
-
{t('workflow.nodes.common.retry.retryInterval')}
+
{t('workflow.nodes.common.retry.retryInterval')}
= ({ : (
-
{!noValue ? item?.label : placeholder}
+ className={cn(showOption && 'bg-state-base-hover', 'flex h-5 cursor-pointer items-center rounded-md pl-1 pr-0.5 text-xs font-semibold text-text-secondary hover:bg-state-base-hover')}> +
{!noValue ? item?.label : placeholder}
{!readonly && }
)} {(showOption && !readonly) && ( -
+
{list.map(item => (
= ({ setHide() onChange(item.value) }} - className={cn(itemClassName, uppercase && 'uppercase', 'flex h-[30px] min-w-[44px] cursor-pointer items-center justify-between rounded-lg px-3 text-[13px] font-medium text-gray-700 hover:bg-gray-50')} + className={cn(itemClassName, uppercase && 'uppercase', 'flex h-[30px] min-w-[44px] cursor-pointer items-center justify-between rounded-lg px-3 text-[13px] font-medium text-text-secondary hover:bg-state-base-hover')} >
{item.label}
- {showChecked && item.value === value && } + {showChecked && item.value === value && }
)) } diff --git a/web/app/components/workflow/nodes/_base/components/title-description-input.tsx b/web/app/components/workflow/nodes/_base/components/title-description-input.tsx index ec0f6fbcda..062190aee9 100644 --- a/web/app/components/workflow/nodes/_base/components/title-description-input.tsx +++ b/web/app/components/workflow/nodes/_base/components/title-description-input.tsx @@ -33,7 +33,7 @@ export const TitleInput = memo(({ value={localValue} onChange={e => setLocalValue(e.target.value)} className={` - system-xl-semibold mr-2 h-7 min-w-0 grow appearance-none rounded-md border border-transparent px-1 text-text-primary + system-xl-semibold mr-2 h-7 min-w-0 grow appearance-none rounded-md border border-transparent bg-transparent px-1 text-text-primary outline-none focus:shadow-xs `} placeholder={t('workflow.common.addTitle') || ''} @@ -76,8 +76,8 @@ export const DescriptionInput = memo(({ onBlur={handleBlur} className={` w-full resize-none appearance-none bg-transparent text-xs - leading-[18px] text-gray-900 caret-[#295EFF] - outline-none placeholder:text-gray-400 + leading-[18px] text-text-primary caret-[#295EFF] + outline-none placeholder:text-text-quaternary `} placeholder={t('workflow.common.addDescription') || ''} /> diff --git a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx index 5a5553b18c..83b07715fe 100644 --- a/web/app/components/workflow/nodes/_base/components/variable-tag.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable-tag.tsx @@ -51,7 +51,7 @@ const VariableTag = ({ const { t } = useTranslation() return ( -
{(!isEnv && !isChatVar && <> @@ -59,7 +59,7 @@ const VariableTag = ({ <>
= ({ isSupportFileVar={isSupportFileVar} /> {!readonly && ( - + )}
))} diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx index a9b51d5a1e..568dd7150a 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx @@ -333,9 +333,9 @@ const VarReferencePicker: FC = ({ }} className='h-full grow' > -
+
-
+
{hasValue ? ( <> @@ -343,17 +343,17 @@ const VarReferencePicker: FC = ({
{outputVarNode?.type && }
-
{outputVarNode?.title}
)} -
+
{!hasValue && } {isEnv && } {isChatVar && } @@ -364,7 +364,7 @@ const VarReferencePicker: FC = ({
{type}
- {!isValidVar && } + {!isValidVar && } ) :
{placeholder ?? t('workflow.common.setVarValuePlaceholder')}
} @@ -375,10 +375,10 @@ const VarReferencePicker: FC = ({ )} {(hasValue && !readonly && !isInTable) && (
- +
)} {!hasValue && valueTypePlaceHolder && ( = ({ const { locale } = useContext(I18n) // max-h-[300px] overflow-y-auto todo: use portal to handle long list return ( -
{((!vars || vars.length === 0) && popupFor) diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx index dc48f9f795..926d7ac705 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-type-picker.tsx @@ -43,23 +43,23 @@ const VarReferencePicker: FC = ({ offset={4} > setOpen(!open)} className='w-[120px] cursor-pointer'> -
+
{value}
- +
-
+
{TYPES.map(type => (
{type}
- {type === value && } + {type === value && }
))}
diff --git a/web/app/components/workflow/nodes/_base/hooks/use-toggle-expend.ts b/web/app/components/workflow/nodes/_base/hooks/use-toggle-expend.ts index 4c980ee7d1..e90f079761 100644 --- a/web/app/components/workflow/nodes/_base/hooks/use-toggle-expend.ts +++ b/web/app/components/workflow/nodes/_base/hooks/use-toggle-expend.ts @@ -20,9 +20,9 @@ const useToggleExpend = ({ ref, hasFooter = true, isInNode }: Params) => { return '' if (isInNode) - return 'fixed z-10 right-[9px] top-[166px] bottom-[8px] p-4 bg-white rounded-xl' + return 'fixed z-10 right-[9px] top-[166px] bottom-[8px] p-4 bg-components-panel-bg rounded-xl' - return 'absolute z-10 left-4 right-6 top-[52px] bottom-0 pb-4 bg-white' + return 'absolute z-10 left-4 right-6 top-[52px] bottom-0 pb-4 bg-components-panel-bg' })() const wrapStyle = isExpand ? { diff --git a/web/app/components/workflow/nodes/_base/panel.tsx b/web/app/components/workflow/nodes/_base/panel.tsx index dee94cf291..2ee39a3b06 100644 --- a/web/app/components/workflow/nodes/_base/panel.tsx +++ b/web/app/components/workflow/nodes/_base/panel.tsx @@ -119,7 +119,7 @@ const BasePanel: FC = ({ width: `${panelWidth}px`, }} > -
+
= ({ value={data.title || ''} onBlur={handleTitleBlur} /> -
+
{ canRunBySingle(data.type) && !nodesReadOnly && ( = ({ popupClassName='mr-1' >
{ handleNodeDataUpdate({ id, data: { _isSingleRun: true } }) handleSyncWorkflowDraft(true) @@ -169,7 +169,7 @@ const BasePanel: FC = ({
- {cloneElement(children, { id, data })} + {cloneElement(children as any, { id, data })}
{ @@ -190,7 +190,7 @@ const BasePanel: FC = ({ } { !!availableNextBlocks.length && ( -
+
{t('workflow.panel.nextStep').toLocaleUpperCase()}
diff --git a/web/app/components/workflow/nodes/end/node.tsx b/web/app/components/workflow/nodes/end/node.tsx index dae8a6de3c..e0c5604391 100644 --- a/web/app/components/workflow/nodes/end/node.tsx +++ b/web/app/components/workflow/nodes/end/node.tsx @@ -52,13 +52,13 @@ const Node: FC> = ({ isChatMode, }) return ( -
-
+
+
{!isEnv && !isChatVar && ( <>
@@ -66,16 +66,16 @@ const Node: FC> = ({ )} -
- {!isEnv && !isChatVar && } +
+ {!isEnv && !isChatVar && } {isEnv && } {isChatVar && } -
{varName}
+
{varName}
-
-
{varType}
+
+
{varType}
) diff --git a/web/app/components/workflow/nodes/http/components/api-input.tsx b/web/app/components/workflow/nodes/http/components/api-input.tsx index 164926b9c2..000011e4cd 100644 --- a/web/app/components/workflow/nodes/http/components/api-input.tsx +++ b/web/app/components/workflow/nodes/http/components/api-input.tsx @@ -53,9 +53,9 @@ const ApiInput: FC = ({ onChange={onMethodChange} options={MethodOptions} trigger={ -
-
{method}
- {!readonly && } +
+
{method}
+ {!readonly && }
} popupClassName='top-[34px] w-[108px]' @@ -65,7 +65,7 @@ const ApiInput: FC = ({ { return (
-
+
{title} - {isRequired && *} + {isRequired && *}
{children}
@@ -158,7 +158,7 @@ const Authorization: FC = ({
= ({ return (
{title} diff --git a/web/app/components/workflow/nodes/http/components/curl-panel.tsx b/web/app/components/workflow/nodes/http/components/curl-panel.tsx index f2e1a44488..52e28d7336 100644 --- a/web/app/components/workflow/nodes/http/components/curl-panel.tsx +++ b/web/app/components/workflow/nodes/http/components/curl-panel.tsx @@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next' import { BodyType, type HttpNodeType, Method } from '../types' import Modal from '@/app/components/base/modal' import Button from '@/app/components/base/button' +import Textarea from '@/app/components/base/textarea' import Toast from '@/app/components/base/toast' import { useNodesInteractions } from '@/app/components/workflow/hooks' @@ -141,9 +142,9 @@ const CurlPanel: FC = ({ nodeId, isShow, onHide, handleCurlImport }) => { className='!w-[400px] !max-w-[400px] !p-4' >
-