mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
@@ -2,7 +2,7 @@ import { createPortal } from 'react-dom'
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useSelector } from 'react-redux'
|
||||
import PropTypes from 'prop-types'
|
||||
import { Dialog, DialogContent, DialogTitle } from '@mui/material'
|
||||
import { Box, Dialog, DialogContent, DialogTitle, Typography } from '@mui/material'
|
||||
import ReactJson from 'flowise-react-json-view'
|
||||
|
||||
const SourceDocDialog = ({ show, dialogProps, onCancel }) => {
|
||||
@@ -32,6 +32,25 @@ const SourceDocDialog = ({ show, dialogProps, onCancel }) => {
|
||||
{dialogProps.title ?? 'Source Documents'}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
{data.error && (
|
||||
<Box
|
||||
sx={{
|
||||
p: 2,
|
||||
borderRadius: 1,
|
||||
bgcolor: 'error.light',
|
||||
color: 'error.dark',
|
||||
overflowX: 'auto',
|
||||
wordBreak: 'break-word'
|
||||
}}
|
||||
>
|
||||
<Typography variant='body2' fontWeight='medium'>
|
||||
Error:
|
||||
</Typography>
|
||||
<Typography variant='body2' sx={{ whiteSpace: 'pre-wrap' }}>
|
||||
{data.error}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
<ReactJson
|
||||
theme={customization.isDarkMode ? 'ocean' : 'rjv-default'}
|
||||
style={{ padding: 10, borderRadius: 10 }}
|
||||
|
||||
@@ -1214,10 +1214,30 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||
key={index}
|
||||
label={tool.tool}
|
||||
component='a'
|
||||
sx={{ mr: 1, mt: 1 }}
|
||||
sx={{
|
||||
mr: 1,
|
||||
mt: 1,
|
||||
borderColor: tool.error
|
||||
? 'error.main'
|
||||
: undefined,
|
||||
color: tool.error
|
||||
? 'error.main'
|
||||
: undefined
|
||||
}}
|
||||
variant='outlined'
|
||||
clickable
|
||||
icon={<IconTool size={15} />}
|
||||
icon={
|
||||
<IconTool
|
||||
size={15}
|
||||
color={
|
||||
tool.error
|
||||
? theme.palette
|
||||
.error
|
||||
.main
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
}
|
||||
onClick={() =>
|
||||
onSourceDialogClick(
|
||||
tool,
|
||||
@@ -1407,9 +1427,24 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
||||
key={index}
|
||||
label={tool.tool}
|
||||
component='a'
|
||||
sx={{ mr: 1, mt: 1 }}
|
||||
sx={{
|
||||
mr: 1,
|
||||
mt: 1,
|
||||
borderColor: tool.error ? 'error.main' : undefined,
|
||||
color: tool.error ? 'error.main' : undefined
|
||||
}}
|
||||
variant='outlined'
|
||||
clickable
|
||||
icon={
|
||||
<IconTool
|
||||
size={15}
|
||||
color={
|
||||
tool.error
|
||||
? theme.palette.error.main
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
}
|
||||
onClick={() => onSourceDialogClick(tool, 'Used Tools')}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -1677,10 +1677,24 @@ export const ChatMessage = ({ open, chatflowid, isAgentCanvas, isDialog, preview
|
||||
key={index}
|
||||
label={tool.tool}
|
||||
component='a'
|
||||
sx={{ mr: 1, mt: 1 }}
|
||||
sx={{
|
||||
mr: 1,
|
||||
mt: 1,
|
||||
borderColor: tool.error ? 'error.main' : undefined,
|
||||
color: tool.error ? 'error.main' : undefined
|
||||
}}
|
||||
variant='outlined'
|
||||
clickable
|
||||
icon={<IconTool size={15} />}
|
||||
icon={
|
||||
<IconTool
|
||||
size={15}
|
||||
color={
|
||||
tool.error
|
||||
? theme.palette.error.main
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
}
|
||||
onClick={() => onSourceDialogClick(tool, 'Used Tools')}
|
||||
/>
|
||||
) : null
|
||||
@@ -1808,10 +1822,20 @@ export const ChatMessage = ({ open, chatflowid, isAgentCanvas, isDialog, preview
|
||||
key={index}
|
||||
label={tool.tool}
|
||||
component='a'
|
||||
sx={{ mr: 1, mt: 1 }}
|
||||
sx={{
|
||||
mr: 1,
|
||||
mt: 1,
|
||||
borderColor: tool.error ? 'error.main' : undefined,
|
||||
color: tool.error ? 'error.main' : undefined
|
||||
}}
|
||||
variant='outlined'
|
||||
clickable
|
||||
icon={<IconTool size={15} />}
|
||||
icon={
|
||||
<IconTool
|
||||
size={15}
|
||||
color={tool.error ? theme.palette.error.main : undefined}
|
||||
/>
|
||||
}
|
||||
onClick={() => onSourceDialogClick(tool, 'Used Tools')}
|
||||
/>
|
||||
) : null
|
||||
|
||||
Reference in New Issue
Block a user