mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 05:01:10 +03:00
Update how uploads are shown in view messages dialog
This commit is contained in:
@@ -632,8 +632,8 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
|||||||
sx={{
|
sx={{
|
||||||
background:
|
background:
|
||||||
message.type === 'apiMessage' ? theme.palette.asyncSelect.main : '',
|
message.type === 'apiMessage' ? theme.palette.asyncSelect.main : '',
|
||||||
pl: 1,
|
py: '1rem',
|
||||||
pr: 1
|
px: '1.5rem'
|
||||||
}}
|
}}
|
||||||
key={index}
|
key={index}
|
||||||
style={{ display: 'flex', justifyContent: 'center', alignContent: 'center' }}
|
style={{ display: 'flex', justifyContent: 'center', alignContent: 'center' }}
|
||||||
@@ -683,34 +683,6 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className='markdownanswer'>
|
|
||||||
{/* Messages are being rendered in Markdown format */}
|
|
||||||
<MemoizedReactMarkdown
|
|
||||||
remarkPlugins={[remarkGfm, remarkMath]}
|
|
||||||
rehypePlugins={[rehypeMathjax, rehypeRaw]}
|
|
||||||
components={{
|
|
||||||
code({ inline, className, children, ...props }) {
|
|
||||||
const match = /language-(\w+)/.exec(className || '')
|
|
||||||
return !inline ? (
|
|
||||||
<CodeBlock
|
|
||||||
key={Math.random()}
|
|
||||||
chatflowid={dialogProps.chatflow.id}
|
|
||||||
isDialog={true}
|
|
||||||
language={(match && match[1]) || ''}
|
|
||||||
value={String(children).replace(/\n$/, '')}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<code className={className} {...props}>
|
|
||||||
{children}
|
|
||||||
</code>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{message.message}
|
|
||||||
</MemoizedReactMarkdown>
|
|
||||||
</div>
|
|
||||||
{message.fileUploads && message.fileUploads.length > 0 && (
|
{message.fileUploads && message.fileUploads.length > 0 && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -756,6 +728,34 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
<div className='markdownanswer'>
|
||||||
|
{/* Messages are being rendered in Markdown format */}
|
||||||
|
<MemoizedReactMarkdown
|
||||||
|
remarkPlugins={[remarkGfm, remarkMath]}
|
||||||
|
rehypePlugins={[rehypeMathjax, rehypeRaw]}
|
||||||
|
components={{
|
||||||
|
code({ inline, className, children, ...props }) {
|
||||||
|
const match = /language-(\w+)/.exec(className || '')
|
||||||
|
return !inline ? (
|
||||||
|
<CodeBlock
|
||||||
|
key={Math.random()}
|
||||||
|
chatflowid={dialogProps.chatflow.id}
|
||||||
|
isDialog={true}
|
||||||
|
language={(match && match[1]) || ''}
|
||||||
|
value={String(children).replace(/\n$/, '')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<code className={className} {...props}>
|
||||||
|
{children}
|
||||||
|
</code>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{message.message}
|
||||||
|
</MemoizedReactMarkdown>
|
||||||
|
</div>
|
||||||
{message.fileAnnotations && (
|
{message.fileAnnotations && (
|
||||||
<div style={{ display: 'block', flexDirection: 'row', width: '100%' }}>
|
<div style={{ display: 'block', flexDirection: 'row', width: '100%' }}>
|
||||||
{message.fileAnnotations.map((fileAnnotation, index) => {
|
{message.fileAnnotations.map((fileAnnotation, index) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user