mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
version panel
This commit is contained in:
@ -152,7 +152,6 @@ export const Workflow: FC<WorkflowProps> = memo(({
|
||||
setAutoFreeze(true)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
handleSyncWorkflowDraft(true, true)
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
export const useConfig = (id: string) => {
|
||||
return {
|
||||
id,
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
import { memo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Field } from '@/app/components/workflow/nodes/_base/components/layout'
|
||||
import type { ChunkStructureEnum } from '../../types'
|
||||
import OptionCard from '../option-card'
|
||||
@ -15,6 +16,7 @@ const ChunkStructure = ({
|
||||
onChunkStructureChange,
|
||||
readonly = false,
|
||||
}: ChunkStructureProps) => {
|
||||
const { t } = useTranslation()
|
||||
const {
|
||||
options,
|
||||
optionMap,
|
||||
@ -23,8 +25,8 @@ const ChunkStructure = ({
|
||||
return (
|
||||
<Field
|
||||
fieldTitleProps={{
|
||||
title: 'Chunk Structure',
|
||||
tooltip: 'Chunk Structure',
|
||||
title: t('workflow.nodes.knowledgeBase.chunkStructure'),
|
||||
tooltip: t('workflow.nodes.knowledgeBase.chunkStructure'),
|
||||
operation: (
|
||||
<Selector
|
||||
options={options}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { useCallback, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
PortalToFollowElem,
|
||||
PortalToFollowElemContent,
|
||||
@ -21,6 +22,7 @@ const Selector = ({
|
||||
onChange,
|
||||
readonly,
|
||||
}: SelectorProps) => {
|
||||
const { t } = useTranslation()
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
const handleSelect = useCallback((optionId: ChunkStructureEnum) => {
|
||||
@ -47,13 +49,13 @@ const Selector = ({
|
||||
size='small'
|
||||
variant='ghost-accent'
|
||||
>
|
||||
change
|
||||
{t('workflow.panel.change')}
|
||||
</Button>
|
||||
</PortalToFollowElemTrigger>
|
||||
<PortalToFollowElemContent className='z-10'>
|
||||
<div className='w-[404px] rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-xl backdrop-blur-[5px]'>
|
||||
<div className='system-sm-semibold px-3 pt-3.5 text-text-primary'>
|
||||
change Chunk Structure
|
||||
{t('workflow.nodes.knowledgeBase.changeChunkStructure')}
|
||||
</div>
|
||||
<div className='space-y-1 p-3 pt-2'>
|
||||
{
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { memo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import VarReferencePicker from '@/app/components/workflow/nodes/_base/components/variable/var-reference-picker'
|
||||
import { Field } from '@/app/components/workflow/nodes/_base/components/layout'
|
||||
import type { ValueSelector } from '@/app/components/workflow/types'
|
||||
@ -15,11 +16,12 @@ const InputVariable = ({
|
||||
onInputVariableChange,
|
||||
readonly = false,
|
||||
}: InputVariableProps) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<Field
|
||||
fieldTitleProps={{
|
||||
title: 'Input Variable',
|
||||
tooltip: 'Input Variable',
|
||||
title: t('workflow.nodes.common.inputVars'),
|
||||
}}
|
||||
>
|
||||
<VarReferencePicker
|
||||
|
||||
@ -62,8 +62,7 @@ const RetrievalSetting = ({
|
||||
subTitle: (
|
||||
<div className='body-xs-regular flex items-center text-text-tertiary'>
|
||||
<a target='_blank' rel='noopener noreferrer' href='https://docs.dify.ai/guides/knowledge-base/create-knowledge-and-upload-documents#id-4-retrieval-settings' className='text-text-accent'>{t('datasetSettings.form.retrievalSetting.learnMore')}</a>
|
||||
|
||||
about retrieval method.
|
||||
{t('workflow.nodes.knowledgeBase.aboutRetrieval')}
|
||||
</div>
|
||||
),
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user