mirror of
https://github.com/langgenius/dify.git
synced 2026-01-07 23:04:12 +00:00
fix
This commit is contained in:
@@ -89,7 +89,7 @@ const UploaderButton: FC<UploaderButtonProps> = ({
|
||||
</PortalToFollowElemTrigger>
|
||||
<PortalToFollowElemContent className="z-50">
|
||||
<div className="p-2 w-[260px] bg-white rounded-lg border-[0.5px] border-gray-200 shadow-lg">
|
||||
<ImageLinkInput onUpload={handleUpload} />
|
||||
<ImageLinkInput onUpload={handleUpload} disabled={disabled} />
|
||||
{hasUploadFromLocal && (
|
||||
<>
|
||||
<div className="flex items-center mt-2 px-2 text-xs font-medium text-gray-400">
|
||||
|
||||
@@ -7,15 +7,20 @@ import { TransferMethod } from '@/types/app'
|
||||
|
||||
type ImageLinkInputProps = {
|
||||
onUpload: (imageFile: ImageFile) => void
|
||||
disabled?: boolean
|
||||
}
|
||||
const regex = /^(https?|ftp):\/\//
|
||||
const ImageLinkInput: FC<ImageLinkInputProps> = ({
|
||||
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<ImageLinkInputProps> = ({
|
||||
<Button
|
||||
type='primary'
|
||||
className='!h-6 text-xs font-medium'
|
||||
disabled={!imageLink}
|
||||
disabled={!imageLink || disabled}
|
||||
onClick={handleClick}
|
||||
>
|
||||
{t('common.operation.ok')}
|
||||
|
||||
@@ -79,7 +79,11 @@ const Publish = () => {
|
||||
${runningStatus && 'cursor-not-allowed opacity-50'}
|
||||
`}
|
||||
>
|
||||
{t('workflow.common.publish')}
|
||||
{
|
||||
published
|
||||
? t('workflow.common.published')
|
||||
: t('workflow.common.publish')
|
||||
}
|
||||
</Button>
|
||||
</PortalToFollowElemTrigger>
|
||||
<PortalToFollowElemContent className='z-[11]'>
|
||||
|
||||
@@ -135,7 +135,7 @@ const RunAndHistory: FC = () => {
|
||||
${showRunHistory && 'bg-primary-50'}
|
||||
`}
|
||||
onClick={() => {
|
||||
workflowStore.setState({ showRunHistory: !showRunHistory })
|
||||
workflowStore.setState({ showRunHistory: !showRunHistory, workflowRunId: '' })
|
||||
setCurrentLogItem()
|
||||
setShowMessageLogModal(false)
|
||||
}}
|
||||
|
||||
@@ -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 (
|
||||
<div
|
||||
@@ -68,7 +69,7 @@ const Panel: FC = () => {
|
||||
)
|
||||
}
|
||||
{
|
||||
runningStatus && isChatMode && showRunHistory && (
|
||||
runningStatus && isChatMode && showRunHistory && currentConversationID && (
|
||||
<Record />
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user