mirror of https://github.com/langgenius/dify.git
feat: run result data too long export
This commit is contained in:
parent
b4e76af4a7
commit
3c4b374038
|
|
@ -39,6 +39,7 @@ type Props = {
|
|||
tip?: React.JSX.Element
|
||||
nodesOutputVars?: NodeOutPutVar[]
|
||||
availableNodes?: Node[]
|
||||
footer?: React.ReactNode
|
||||
}
|
||||
|
||||
const Base: FC<Props> = ({
|
||||
|
|
@ -57,6 +58,7 @@ const Base: FC<Props> = ({
|
|||
showFileList,
|
||||
showCodeGenerator = false,
|
||||
tip,
|
||||
footer,
|
||||
}) => {
|
||||
const ref = useRef<HTMLDivElement>(null)
|
||||
const {
|
||||
|
|
@ -128,6 +130,7 @@ const Base: FC<Props> = ({
|
|||
{showFileList && fileList.length > 0 && (
|
||||
<FileListInLog fileList={fileList} />
|
||||
)}
|
||||
{footer}
|
||||
</div>
|
||||
</Wrap>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ export type Props = {
|
|||
showCodeGenerator?: boolean
|
||||
className?: string
|
||||
tip?: React.JSX.Element
|
||||
footer?: React.ReactNode
|
||||
}
|
||||
|
||||
export const languageMap = {
|
||||
|
|
@ -67,6 +68,7 @@ const CodeEditor: FC<Props> = ({
|
|||
showCodeGenerator = false,
|
||||
className,
|
||||
tip,
|
||||
footer,
|
||||
}) => {
|
||||
const [isFocus, setIsFocus] = React.useState(false)
|
||||
const [isMounted, setIsMounted] = React.useState(false)
|
||||
|
|
@ -191,6 +193,7 @@ const CodeEditor: FC<Props> = ({
|
|||
showFileList={showFileList}
|
||||
showCodeGenerator={showCodeGenerator}
|
||||
tip={tip}
|
||||
footer={footer}
|
||||
>
|
||||
{main}
|
||||
</Base>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import { IterationLogTrigger } from '@/app/components/workflow/run/iteration-log
|
|||
import { LoopLogTrigger } from '@/app/components/workflow/run/loop-log'
|
||||
import { RetryLogTrigger } from '@/app/components/workflow/run/retry-log'
|
||||
import { AgentLogTrigger } from '@/app/components/workflow/run/agent-log'
|
||||
import LargeDataAlert from '../variable-inspect/large-data-alert'
|
||||
|
||||
export type ResultPanelProps = {
|
||||
nodeInfo?: NodeTracing
|
||||
|
|
@ -118,6 +119,7 @@ const ResultPanel: FC<ResultPanelProps> = ({
|
|||
language={CodeLanguage.json}
|
||||
value={inputs}
|
||||
isJSONStringifyBeauty
|
||||
footer={<LargeDataAlert textHasNoExport className='mx-1 mb-1 mt-2' />}
|
||||
/>
|
||||
{process_data && (
|
||||
<CodeEditor
|
||||
|
|
@ -136,6 +138,7 @@ const ResultPanel: FC<ResultPanelProps> = ({
|
|||
value={outputs}
|
||||
isJSONStringifyBeauty
|
||||
tip={<ErrorHandleTip type={execution_metadata?.error_strategy} />}
|
||||
footer={<LargeDataAlert textHasNoExport downloadUrl='xxx' className='mx-1 mb-1 mt-2' />}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,24 +6,25 @@ import cn from '@/utils/classnames'
|
|||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
type Props = {
|
||||
textHasNoExport?: boolean
|
||||
downloadUrl?: string
|
||||
className?: string
|
||||
}
|
||||
|
||||
const LargeDataAlert: FC<Props> = ({
|
||||
textHasNoExport,
|
||||
downloadUrl,
|
||||
className,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const isShowDownload = !!downloadUrl
|
||||
const text = isShowDownload ? t('workflow.debug.variableInspect.largeDataNoExport') : t('workflow.debug.variableInspect.largeData')
|
||||
const text = textHasNoExport ? t('workflow.debug.variableInspect.largeDataNoExport') : t('workflow.debug.variableInspect.largeData')
|
||||
return (
|
||||
<div className={cn('flex h-8 items-center justify-between rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur px-2 shadow-xs', className)}>
|
||||
<div className='flex h-full w-0 grow items-center space-x-1'>
|
||||
<RiInformation2Fill className='size-4 shrink-0 text-text-accent' />
|
||||
<div className='system-xs-regular w-0 grow truncate text-text-primary'>{text}</div>
|
||||
</div>
|
||||
{isShowDownload && (
|
||||
{downloadUrl && (
|
||||
<div className='system-xs-medium-uppercase ml-1 shrink-0 cursor-pointer text-text-accent'>{t('workflow.debug.variableInspect.export')}</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue