Chore: frontend infrastructure upgrade (#16420)

Co-authored-by: NFish <douxc512@gmail.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
Joel
2025-03-21 17:41:03 +08:00
committed by GitHub
parent e61415223b
commit 7709d9df20
1435 changed files with 13372 additions and 11612 deletions

View File

@@ -68,7 +68,7 @@ const ImportFromTool: FC<Props> = ({
return (
<div>
<div className={cn(
'flex items-center h-6 px-2 cursor-pointer rounded-md hover:bg-gray-100 text-xs font-medium text-gray-500',
'flex h-6 cursor-pointer items-center rounded-md px-2 text-xs font-medium text-gray-500 hover:bg-gray-100',
open && 'bg-gray-100',
)}>
{t(`${i18nPrefix}.importFromTool`)}

View File

@@ -24,36 +24,36 @@ const Item: FC<Props> = ({
const { t } = useTranslation()
return (
<div className='relative px-2.5 py-2 rounded-lg bg-white border-[0.5px] border-gray-200 hover:shadow-xs group'>
<div className='group relative rounded-lg border-[0.5px] border-gray-200 bg-white px-2.5 py-2 hover:shadow-xs'>
<div className='flex justify-between'>
<div className='flex items-center'>
<Variable02 className='w-3.5 h-3.5 text-primary-500' />
<Variable02 className='h-3.5 w-3.5 text-primary-500' />
<div className='ml-1 text-[13px] font-medium text-gray-900'>{payload.name}</div>
<div className='ml-2 text-xs font-normal text-gray-500 capitalize'>{payload.type}</div>
<div className='ml-2 text-xs font-normal capitalize text-gray-500'>{payload.type}</div>
</div>
{payload.required && (
<div className='uppercase leading-4 text-xs font-normal text-gray-500'>{t(`${i18nPrefix}.addExtractParameterContent.required`)}</div>
<div className='text-xs font-normal uppercase leading-4 text-gray-500'>{t(`${i18nPrefix}.addExtractParameterContent.required`)}</div>
)}
</div>
<div className='mt-0.5 leading-[18px] text-xs font-normal text-gray-500'>{payload.description}</div>
<div className='mt-0.5 text-xs font-normal leading-[18px] text-gray-500'>{payload.description}</div>
<div
className='group-hover:flex absolute top-0 right-1 hidden h-full items-center w-[119px] justify-end space-x-1 rounded-lg'
className='absolute right-1 top-0 hidden h-full w-[119px] items-center justify-end space-x-1 rounded-lg group-hover:flex'
style={{
background: 'linear-gradient(270deg, #FFF 49.99%, rgba(255, 255, 255, 0.00) 98.1%)',
}}
>
<div
className='p-1 cursor-pointer rounded-md hover:bg-black/5'
className='cursor-pointer rounded-md p-1 hover:bg-black/5'
onClick={onEdit}
>
<RiEditLine className='w-4 h-4 text-gray-500' />
<RiEditLine className='h-4 w-4 text-gray-500' />
</div>
<div
className='p-1 cursor-pointer rounded-md hover:bg-black/5'
className='cursor-pointer rounded-md p-1 hover:bg-black/5'
onClick={onDelete}
>
<RiDeleteBinLine className='w-4 h-4 text-gray-500' />
<RiDeleteBinLine className='h-4 w-4 text-gray-500' />
</div>
</div>
</div>

View File

@@ -28,7 +28,7 @@ const DEFAULT_PARAM: Param = {
required: false,
}
interface Props {
type Props = {
type: 'add' | 'edit'
payload?: Param
onSave: (payload: Param, moreInfo?: MoreInfo) => void
@@ -171,7 +171,7 @@ const AddExtractParameter: FC<Props> = ({
</Field>
<Field title={t(`${i18nPrefix}.addExtractParameterContent.required`)}>
<>
<div className='mb-1.5 leading-[18px] text-xs font-normal text-gray-500'>{t(`${i18nPrefix}.addExtractParameterContent.requiredContent`)}</div>
<div className='mb-1.5 text-xs font-normal leading-[18px] text-gray-500'>{t(`${i18nPrefix}.addExtractParameterContent.requiredContent`)}</div>
<Switch size='l' defaultValue={param.required} onChange={handleParamChange('required')} />
</>
</Field>

View File

@@ -8,7 +8,7 @@ import OptionCard from '../../_base/components/option-card'
const i18nPrefix = 'workflow.nodes.parameterExtractor'
interface Props {
type Props = {
type: ReasoningModeType
onChange: (type: ReasoningModeType) => void
}

View File

@@ -112,7 +112,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
return (
<div className='pt-2'>
<div className='px-4 space-y-4'>
<div className='space-y-4 px-4'>
<Field
title={t(`${i18nCommonPrefix}.model`)}
>
@@ -164,7 +164,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
{!readOnly && (
<ImportFromTool onImport={handleImportFromTool} />
)}
{!readOnly && (<div className='w-px h-3 bg-gray-200'></div>)}
{!readOnly && (<div className='h-3 w-px bg-gray-200'></div>)}
<AddExtractParameter type='add' onSave={addExtractParameter} />
</div>
)

View File

@@ -10,7 +10,7 @@ export enum ParamType {
arrayObject = 'array[object]',
}
export interface Param {
export type Param = {
name: string
type: ParamType
options?: string[]