mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-08 20:29:16 +08:00
support reset conversation variable value
This commit is contained in:
parent
4ba525c4c9
commit
9fd850b449
@ -2,6 +2,7 @@ import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
RiArrowGoBackLine,
|
||||
RiCloseLine,
|
||||
RiDeleteBinLine,
|
||||
RiMenuLine,
|
||||
} from '@remixicon/react'
|
||||
import { useStore } from '../store'
|
||||
@ -38,6 +39,7 @@ const Right = ({
|
||||
const setCurrentFocusNodeId = useStore(s => s.setCurrentFocusNodeId)
|
||||
|
||||
const {
|
||||
resetConversationVar,
|
||||
resetToLastRunVar,
|
||||
editInspectVarValue,
|
||||
} = useCurrentVars()
|
||||
@ -57,6 +59,11 @@ const Right = ({
|
||||
setCurrentFocusNodeId('')
|
||||
}
|
||||
|
||||
const handleClear = () => {
|
||||
if (!currentNodeVar) return
|
||||
resetConversationVar(currentNodeVar.var.id)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={cn('flex h-full flex-col')}>
|
||||
{/* header */}
|
||||
@ -110,6 +117,13 @@ const Right = ({
|
||||
</ActionButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
{currentNodeVar.var.type === VarInInspectType.conversation && (
|
||||
<Tooltip popupContent={t('workflow.debug.variableInspect.clearNode')}>
|
||||
<ActionButton onClick={handleClear}>
|
||||
<RiDeleteBinLine className='h-4 w-4' />
|
||||
</ActionButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
{currentNodeVar.var.value_type !== 'secret' && (
|
||||
<CopyFeedback content={currentNodeVar.var.value ? JSON.stringify(currentNodeVar.var.value) : ''} />
|
||||
)}
|
||||
|
@ -924,7 +924,7 @@ const translation = {
|
||||
title: 'Variable Inspect',
|
||||
emptyTip: 'After stepping through a node on the canvas or running a node step by step, you can view the current value of the node variable in Variable Inspect',
|
||||
emptyLink: 'Learn more',
|
||||
clearAll: 'Clear all',
|
||||
clearAll: 'Reset all',
|
||||
clearNode: 'Clear cached variable',
|
||||
view: 'View log',
|
||||
edited: 'Edited',
|
||||
|
@ -925,7 +925,7 @@ const translation = {
|
||||
title: '变量检查',
|
||||
emptyTip: '在画布上逐步浏览节点或逐步运行节点后,您可以在变量检查中查看节点变量的当前值',
|
||||
emptyLink: '了解更多',
|
||||
clearAll: '清除所有',
|
||||
clearAll: '重置所有',
|
||||
clearNode: '清除缓存',
|
||||
view: '查看记录',
|
||||
edited: '已编辑',
|
||||
|
Loading…
x
Reference in New Issue
Block a user