Feat/attachments (#9526)

Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: JzoNg <jzongcode@gmail.com>
This commit is contained in:
zxhlyh 2024-10-21 10:32:37 +08:00 • committed by GitHub
commit 7a1d6fe509
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
445 changed files with 11759 additions and 6922 deletions

View file

@ -10,6 +10,7 @@ import InputVarTypeIcon from '../../_base/components/input-var-type-icon'
import type { InputVar, MoreInfo } from '@/app/components/workflow/types'
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
import { Edit03 } from '@/app/components/base/icons/src/vender/solid/general'
import Badge from '@/app/components/base/badge'
import ConfigVarModal from '@/app/components/app/configuration/config-var/config-modal'
type Props = {
@ -19,6 +20,7 @@ type Props = {
onRemove?: () => void
rightContent?: JSX.Element
varKeys?: string[]
showLegacyBadge?: boolean
}
const VarItem: FC<Props> = ({
@ -28,6 +30,7 @@ const VarItem: FC<Props> = ({
onRemove = () => { },
rightContent,
varKeys = [],
showLegacyBadge = false,
}) => {
const { t } = useTranslation()
@ -50,6 +53,12 @@ const VarItem: FC<Props> = ({
{payload.label && (<><div className='shrink-0 text-xs font-medium text-gray-400'>·</div>
<div title={payload.label as string} className='max-w-[130px] truncate text-[13px] font-medium text-gray-500'>{payload.label as string}</div>
</>)}
{showLegacyBadge && (
<Badge
text='LEGACY'
className='shrink-0 border-text-accent-secondary text-text-accent-secondary'
/>
)}
</div>
<div className='shrink-0 ml-2 flex items-center'>
{rightContent || (<>
@ -79,6 +88,7 @@ const VarItem: FC<Props> = ({
isShowEditVarModal && (
<ConfigVarModal
isShow
supportFile
payload={payload}
onClose={hideEditVarModal}
onConfirm={handlePayloadChange}

View file

@ -73,6 +73,7 @@ const Panel: FC<NodePanelProps<StartNodeType>> = ({
<VarItem
readonly
showLegacyBadge={!isChatMode}
payload={{
variable: 'sys.files',
} as any}
@ -163,6 +164,7 @@ const Panel: FC<NodePanelProps<StartNodeType>> = ({
{isShowAddVarModal && (
<ConfigVarModal
isCreate
supportFile
isShow={isShowAddVarModal}
onClose={hideAddVarModal}
onConfirm={handleAddVarConfirm}