mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
feat: start build in vars show
This commit is contained in:
@ -1,8 +1,59 @@
|
||||
import type { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Split from '@/app/components/workflow/nodes/_base/components/split'
|
||||
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
||||
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
|
||||
|
||||
const i18nPrefix = 'workflow.nodes.start'
|
||||
|
||||
const Panel: FC = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<div>start panel inputs</div>
|
||||
<div className='mt-2'>
|
||||
<div className='px-4 pb-4 space-y-4'>
|
||||
<Field
|
||||
title={t(`${i18nPrefix}.model`)}
|
||||
>
|
||||
ss
|
||||
</Field>
|
||||
</div>
|
||||
<Split />
|
||||
|
||||
<div className='px-4 pt-4 pb-2'>
|
||||
<OutputVars title={t(`${i18nPrefix}.builtInVar`)!}>
|
||||
<>
|
||||
<VarItem
|
||||
name='sys.query'
|
||||
type='string'
|
||||
description={t(`${i18nPrefix}.outputVars.query`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='sys.memories'
|
||||
type='array[Object]'
|
||||
description={t(`${i18nPrefix}.outputVars.memories.des`)}
|
||||
subItems={[
|
||||
{
|
||||
name: 'type',
|
||||
type: 'string',
|
||||
description: t(`${i18nPrefix}.outputVars.memories.type`),
|
||||
},
|
||||
{
|
||||
name: 'content',
|
||||
type: 'string',
|
||||
description: t(`${i18nPrefix}.outputVars.memories.content`),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<VarItem
|
||||
name='sys.files'
|
||||
type='string'
|
||||
description={t(`${i18nPrefix}.outputVars.files`)}
|
||||
/>
|
||||
</>
|
||||
</OutputVars>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
12
web/app/components/workflow/nodes/start/use-config.ts
Normal file
12
web/app/components/workflow/nodes/start/use-config.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { useState } from 'react'
|
||||
import type { StartNodeType } from './types'
|
||||
|
||||
const useConfig = (initInputs: StartNodeType) => {
|
||||
const [inputs, setInputs] = useState<StartNodeType>(initInputs)
|
||||
|
||||
return {
|
||||
inputs,
|
||||
}
|
||||
}
|
||||
|
||||
export default useConfig
|
||||
Reference in New Issue
Block a user