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:
parent
e61415223b
commit
7709d9df20
1435 changed files with 13372 additions and 11612 deletions
|
|
@ -12,7 +12,7 @@ import Icon from '@/app/components/plugins/card/base/card-icon'
|
|||
import Description from '@/app/components/plugins/card/base/description'
|
||||
import Divider from '@/app/components/base/divider'
|
||||
import type {
|
||||
StrategyDetail,
|
||||
StrategyDetail as StrategyDetailType,
|
||||
} from '@/app/components/plugins/types'
|
||||
import type { Locale } from '@/i18n'
|
||||
import { useRenderI18nObject } from '@/hooks/use-i18n'
|
||||
|
|
@ -29,7 +29,7 @@ type Props = {
|
|||
label: Record<Locale, string>
|
||||
tags: string[]
|
||||
}
|
||||
detail: StrategyDetail
|
||||
detail: StrategyDetailType
|
||||
onHide: () => void
|
||||
}
|
||||
|
||||
|
|
@ -78,50 +78,50 @@ const StrategyDetail: FC<Props> = ({
|
|||
footer={null}
|
||||
mask={false}
|
||||
positionCenter={false}
|
||||
panelClassname={cn('justify-start mt-[64px] mr-2 mb-2 !w-[420px] !max-w-[420px] !p-0 !bg-components-panel-bg rounded-2xl border-[0.5px] border-components-panel-border shadow-xl')}
|
||||
panelClassname={cn('mb-2 mr-2 mt-[64px] !w-[420px] !max-w-[420px] justify-start rounded-2xl border-[0.5px] border-components-panel-border !bg-components-panel-bg !p-0 shadow-xl')}
|
||||
>
|
||||
<>
|
||||
{/* header */}
|
||||
<div className='relative p-4 pb-3 border-b border-divider-subtle'>
|
||||
<div className='absolute top-3 right-3'>
|
||||
<div className='relative border-b border-divider-subtle p-4 pb-3'>
|
||||
<div className='absolute right-3 top-3'>
|
||||
<ActionButton onClick={onHide}>
|
||||
<RiCloseLine className='w-4 h-4' />
|
||||
<RiCloseLine className='h-4 w-4' />
|
||||
</ActionButton>
|
||||
</div>
|
||||
<div
|
||||
className='mb-2 flex items-center gap-1 text-text-accent-secondary system-xs-semibold-uppercase cursor-pointer'
|
||||
className='system-xs-semibold-uppercase mb-2 flex cursor-pointer items-center gap-1 text-text-accent-secondary'
|
||||
onClick={onHide}
|
||||
>
|
||||
<RiArrowLeftLine className='w-4 h-4' />
|
||||
<RiArrowLeftLine className='h-4 w-4' />
|
||||
BACK
|
||||
</div>
|
||||
<div className='flex items-center gap-1'>
|
||||
<Icon size='tiny' className='w-6 h-6' src={`${API_PREFIX}/workspaces/current/plugin/icon?tenant_id=${provider.tenant_id}&filename=${provider.icon}`} />
|
||||
<Icon size='tiny' className='h-6 w-6' src={`${API_PREFIX}/workspaces/current/plugin/icon?tenant_id=${provider.tenant_id}&filename=${provider.icon}`} />
|
||||
<div className=''>{getValueFromI18nObject(provider.label)}</div>
|
||||
</div>
|
||||
<div className='mt-1 text-text-primary system-md-semibold'>{getValueFromI18nObject(detail.identity.label)}</div>
|
||||
<div className='system-md-semibold mt-1 text-text-primary'>{getValueFromI18nObject(detail.identity.label)}</div>
|
||||
<Description className='mt-3' text={getValueFromI18nObject(detail.description)} descriptionLineRows={2}></Description>
|
||||
</div>
|
||||
{/* form */}
|
||||
<div className='h-full'>
|
||||
<div className='flex flex-col h-full overflow-y-auto'>
|
||||
<div className='p-4 pb-1 text-text-primary system-sm-semibold-uppercase'>{t('tools.setBuiltInTools.parameters')}</div>
|
||||
<div className='flex h-full flex-col overflow-y-auto'>
|
||||
<div className='system-sm-semibold-uppercase p-4 pb-1 text-text-primary'>{t('tools.setBuiltInTools.parameters')}</div>
|
||||
<div className='px-4'>
|
||||
{detail.parameters.length > 0 && (
|
||||
<div className='py-2 space-y-1'>
|
||||
<div className='space-y-1 py-2'>
|
||||
{detail.parameters.map((item: any, index) => (
|
||||
<div key={index} className='py-1'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div className='text-text-secondary code-sm-semibold'>{getValueFromI18nObject(item.label)}</div>
|
||||
<div className='text-text-tertiary system-xs-regular'>
|
||||
<div className='code-sm-semibold text-text-secondary'>{getValueFromI18nObject(item.label)}</div>
|
||||
<div className='system-xs-regular text-text-tertiary'>
|
||||
{getType(item.type)}
|
||||
</div>
|
||||
{item.required && (
|
||||
<div className='text-text-warning-secondary system-xs-medium'>{t('tools.setBuiltInTools.required')}</div>
|
||||
<div className='system-xs-medium text-text-warning-secondary'>{t('tools.setBuiltInTools.required')}</div>
|
||||
)}
|
||||
</div>
|
||||
{item.human_description && (
|
||||
<div className='mt-0.5 text-text-tertiary system-xs-regular'>
|
||||
<div className='system-xs-regular mt-0.5 text-text-tertiary'>
|
||||
{getValueFromI18nObject(item.human_description)}
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -135,17 +135,17 @@ const StrategyDetail: FC<Props> = ({
|
|||
<div className='px-4'>
|
||||
<Divider className="!mt-2" />
|
||||
</div>
|
||||
<div className='p-4 pb-1 text-text-primary system-sm-semibold-uppercase'>OUTPUT</div>
|
||||
<div className='system-sm-semibold-uppercase p-4 pb-1 text-text-primary'>OUTPUT</div>
|
||||
{outputSchema.length > 0 && (
|
||||
<div className='px-4 py-2 space-y-1'>
|
||||
<div className='space-y-1 px-4 py-2'>
|
||||
{outputSchema.map((outputItem, index) => (
|
||||
<div key={index} className='py-1'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div className='text-text-secondary code-sm-semibold'>{outputItem.name}</div>
|
||||
<div className='text-text-tertiary system-xs-regular'>{outputItem.type}</div>
|
||||
<div className='code-sm-semibold text-text-secondary'>{outputItem.name}</div>
|
||||
<div className='system-xs-regular text-text-tertiary'>{outputItem.type}</div>
|
||||
</div>
|
||||
{outputItem.description && (
|
||||
<div className='mt-0.5 text-text-tertiary system-xs-regular'>
|
||||
<div className='system-xs-regular mt-0.5 text-text-tertiary'>
|
||||
{outputItem.description}
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue