From f61ceadec57541b8bc8e536554f3f7863e1d5198 Mon Sep 17 00:00:00 2001 From: StyleZhang Date: Mon, 18 Mar 2024 22:02:59 +0800 Subject: [PATCH] fix --- .../components/base/image-uploader/chat-image-uploader.tsx | 2 +- .../components/base/image-uploader/image-link-input.tsx | 7 ++++++- web/app/components/workflow/header/publish.tsx | 6 +++++- web/app/components/workflow/header/run-and-history.tsx | 2 +- web/app/components/workflow/panel/index.tsx | 7 ++++--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/web/app/components/base/image-uploader/chat-image-uploader.tsx b/web/app/components/base/image-uploader/chat-image-uploader.tsx index 4d34e9c15a..b79dc565b5 100644 --- a/web/app/components/base/image-uploader/chat-image-uploader.tsx +++ b/web/app/components/base/image-uploader/chat-image-uploader.tsx @@ -89,7 +89,7 @@ const UploaderButton: FC = ({
- + {hasUploadFromLocal && ( <>
diff --git a/web/app/components/base/image-uploader/image-link-input.tsx b/web/app/components/base/image-uploader/image-link-input.tsx index d9ca50ac3e..47d4c69ade 100644 --- a/web/app/components/base/image-uploader/image-link-input.tsx +++ b/web/app/components/base/image-uploader/image-link-input.tsx @@ -7,15 +7,20 @@ import { TransferMethod } from '@/types/app' type ImageLinkInputProps = { onUpload: (imageFile: ImageFile) => void + disabled?: boolean } const regex = /^(https?|ftp):\/\// const ImageLinkInput: FC = ({ onUpload, + disabled, }) => { const { t } = useTranslation() const [imageLink, setImageLink] = useState('') const handleClick = () => { + if (disabled) + return + const imageFile = { type: TransferMethod.remote_url, _id: `${Date.now()}`, @@ -39,7 +44,7 @@ const ImageLinkInput: FC = ({ diff --git a/web/app/components/workflow/header/run-and-history.tsx b/web/app/components/workflow/header/run-and-history.tsx index 10fb401252..082ce98086 100644 --- a/web/app/components/workflow/header/run-and-history.tsx +++ b/web/app/components/workflow/header/run-and-history.tsx @@ -135,7 +135,7 @@ const RunAndHistory: FC = () => { ${showRunHistory && 'bg-primary-50'} `} onClick={() => { - workflowStore.setState({ showRunHistory: !showRunHistory }) + workflowStore.setState({ showRunHistory: !showRunHistory, workflowRunId: '' }) setCurrentLogItem() setShowMessageLogModal(false) }} diff --git a/web/app/components/workflow/panel/index.tsx b/web/app/components/workflow/panel/index.tsx index 97c2dfd7a7..5d3bae2cf1 100644 --- a/web/app/components/workflow/panel/index.tsx +++ b/web/app/components/workflow/panel/index.tsx @@ -24,6 +24,7 @@ const Panel: FC = () => { const selectedNode = nodes.find(node => node.data.selected) const showRunHistory = useStore(state => state.showRunHistory) const showInputsPanel = useStore(s => s.showInputsPanel) + const currentConversationID = useStore(s => s.currentConversationID) const { currentLogItem, setCurrentLogItem, showMessageLogModal, setShowMessageLogModal } = useAppStore() const { showWorkflowInfoPanel, @@ -33,9 +34,9 @@ const Panel: FC = () => { return { showWorkflowInfoPanel: !isChatMode && !selectedNode && !runningStatus, showNodePanel: !!selectedNode && !runningStatus, - showDebugAndPreviewPanel: isChatMode && runningStatus && !showRunHistory, + showDebugAndPreviewPanel: isChatMode && runningStatus && !currentConversationID, } - }, [selectedNode, isChatMode, runningStatus, showRunHistory]) + }, [selectedNode, isChatMode, runningStatus, currentConversationID]) return (
{ ) } { - runningStatus && isChatMode && showRunHistory && ( + runningStatus && isChatMode && showRunHistory && currentConversationID && ( ) }