mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
delivery methods
This commit is contained in:
parent
fb6c8fa01f
commit
f04daf056d
@ -0,0 +1,36 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import {
|
||||||
|
RiAddLine,
|
||||||
|
} from '@remixicon/react'
|
||||||
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
|
import ActionButton from '@/app/components/base/action-button'
|
||||||
|
|
||||||
|
const i18nPrefix = 'workflow.nodes.humanInput'
|
||||||
|
|
||||||
|
const DeliveryMethod: React.FC = () => {
|
||||||
|
const { t } = useTranslation()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='px-4 py-2'>
|
||||||
|
<div className='mb-1 flex items-center justify-between'>
|
||||||
|
<div className='flex items-center gap-0.5'>
|
||||||
|
<div className='system-sm-semibold-uppercase text-text-secondary'>{t(`${i18nPrefix}.deliveryMethod.title`)}</div>
|
||||||
|
<Tooltip
|
||||||
|
popupContent={t(`${i18nPrefix}.deliveryMethod.tooltip`)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='flex items-center px-1'>
|
||||||
|
<ActionButton
|
||||||
|
onClick={() => { /* Add new user action logic here */ }}
|
||||||
|
>
|
||||||
|
<RiAddLine className='h-4 w-4' />
|
||||||
|
</ActionButton>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className='system-xs-regular flex items-center justify-center rounded-[10px] bg-background-section p-3 text-text-tertiary'>{t(`${i18nPrefix}.deliveryMethod.emptyTip`)}</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default DeliveryMethod
|
||||||
@ -11,6 +11,7 @@ import type { NodePanelProps } from '@/app/components/workflow/types'
|
|||||||
import ActionButton from '@/app/components/base/action-button'
|
import ActionButton from '@/app/components/base/action-button'
|
||||||
import Tooltip from '@/app/components/base/tooltip'
|
import Tooltip from '@/app/components/base/tooltip'
|
||||||
import Divider from '@/app/components/base/divider'
|
import Divider from '@/app/components/base/divider'
|
||||||
|
import DeliveryMethod from './components/delivery-method'
|
||||||
import UserActionItem from './components/user-action'
|
import UserActionItem from './components/user-action'
|
||||||
import TimeoutInput from './components/timeout'
|
import TimeoutInput from './components/timeout'
|
||||||
import { v4 as uuid4 } from 'uuid'
|
import { v4 as uuid4 } from 'uuid'
|
||||||
@ -31,6 +32,12 @@ const Panel: FC<NodePanelProps<HumanInputNodeType>> = ({
|
|||||||
} = useConfig(id, data)
|
} = useConfig(id, data)
|
||||||
return (
|
return (
|
||||||
<div className='py-2'>
|
<div className='py-2'>
|
||||||
|
{/* delivery methods */}
|
||||||
|
<DeliveryMethod />
|
||||||
|
<div className='px-4 py-2'>
|
||||||
|
<Divider className='!my-0 !h-px !bg-divider-subtle' />
|
||||||
|
</div>
|
||||||
|
{/* user actions */}
|
||||||
<div className='px-4 py-2'>
|
<div className='px-4 py-2'>
|
||||||
<div className='mb-1 flex items-center justify-between'>
|
<div className='mb-1 flex items-center justify-between'>
|
||||||
<div className='flex items-center gap-0.5'>
|
<div className='flex items-center gap-0.5'>
|
||||||
@ -73,6 +80,7 @@ const Panel: FC<NodePanelProps<HumanInputNodeType>> = ({
|
|||||||
<div className='px-4 py-2'>
|
<div className='px-4 py-2'>
|
||||||
<Divider className='!my-0 !h-px !bg-divider-subtle' />
|
<Divider className='!my-0 !h-px !bg-divider-subtle' />
|
||||||
</div>
|
</div>
|
||||||
|
{/* timeout */}
|
||||||
<div className='flex items-center justify-between px-4 py-2'>
|
<div className='flex items-center justify-between px-4 py-2'>
|
||||||
<div className='system-sm-semibold-uppercase text-text-secondary'>{t(`${i18nPrefix}.timeout.title`)}</div>
|
<div className='system-sm-semibold-uppercase text-text-secondary'>{t(`${i18nPrefix}.timeout.title`)}</div>
|
||||||
<TimeoutInput
|
<TimeoutInput
|
||||||
|
|||||||
@ -907,6 +907,8 @@ const translation = {
|
|||||||
humanInput: {
|
humanInput: {
|
||||||
deliveryMethod: {
|
deliveryMethod: {
|
||||||
title: 'Delivery Method',
|
title: 'Delivery Method',
|
||||||
|
tooltip: 'How the human input form is delivered to the user.',
|
||||||
|
emptyTip: 'No delivery method added, the operation cannot be triggered.',
|
||||||
},
|
},
|
||||||
formContent: 'form content',
|
formContent: 'form content',
|
||||||
userActions: {
|
userActions: {
|
||||||
|
|||||||
@ -908,6 +908,8 @@ const translation = {
|
|||||||
humanInput: {
|
humanInput: {
|
||||||
deliveryMethod: {
|
deliveryMethod: {
|
||||||
title: '提交方式',
|
title: '提交方式',
|
||||||
|
tooltip: '人类输入表单如何传递给用户。',
|
||||||
|
emptyTip: '未添加提交方式,无法触发操作。',
|
||||||
},
|
},
|
||||||
formContent: '表单内容',
|
formContent: '表单内容',
|
||||||
userActions: {
|
userActions: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user