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

@@ -77,9 +77,9 @@ const ConfigParamModal: FC<Props> = ({
<Modal
isShow={isShow}
onClose={onHide}
className='!p-6 !mt-14 !max-w-none !w-[640px]'
className='!mt-14 !w-[640px] !max-w-none !p-6'
>
<div className='mb-2 title-2xl-semi-bold text-text-primary'>
<div className='title-2xl-semi-bold mb-2 text-text-primary'>
{t(`appAnnotation.initSetup.${isInit ? 'title' : 'configTitle'}`)}
</div>
@@ -122,7 +122,7 @@ const ConfigParamModal: FC<Props> = ({
</Item>
</div>
<div className='mt-6 flex gap-2 justify-end'>
<div className='mt-6 flex justify-end gap-2'>
<Button onClick={onHide}>{t('common.operation.cancel')}</Button>
<Button
variant='primary'

View File

@@ -3,18 +3,18 @@ import type { FC } from 'react'
import React from 'react'
import Tooltip from '@/app/components/base/tooltip'
export const Item: FC<{ title: string; tooltip: string; children: JSX.Element }> = ({
export const Item: FC<{ title: string; tooltip: string; children: React.JSX.Element }> = ({
title,
tooltip,
children,
}) => {
return (
<div>
<div className='flex items-center space-x-1 mb-1'>
<div className='py-1 system-sm-semibold text-text-secondary'>{title}</div>
<div className='mb-1 flex items-center space-x-1'>
<div className='system-sm-semibold py-1 text-text-secondary'>{title}</div>
<Tooltip
popupContent={
<div className='max-w-[200px] system-sm-regular text-text-secondary'>{tooltip}</div>
<div className='system-sm-regular max-w-[200px] text-text-secondary'>{tooltip}</div>
}
/>
</div>

View File

@@ -77,8 +77,8 @@ const AnnotationReply = ({
<>
<FeatureCard
icon={
<div className='shrink-0 p-1 rounded-lg border-[0.5px] border-divider-subtle shadow-xs bg-util-colors-indigo-indigo-600'>
<MessageFast className='w-4 h-4 text-text-primary-on-surface' />
<div className='shrink-0 rounded-lg border-[0.5px] border-divider-subtle bg-util-colors-indigo-indigo-600 p-1 shadow-xs'>
<MessageFast className='h-4 w-4 text-text-primary-on-surface' />
</div>
}
title={t('appDebug.feature.annotation.title')}
@@ -90,33 +90,33 @@ const AnnotationReply = ({
>
<>
{!annotationReply?.enabled && (
<div className='min-h-8 text-text-tertiary system-xs-regular line-clamp-2'>{t('appDebug.feature.annotation.description')}</div>
<div className='system-xs-regular line-clamp-2 min-h-8 text-text-tertiary'>{t('appDebug.feature.annotation.description')}</div>
)}
{!!annotationReply?.enabled && (
<>
{!isHovering && (
<div className='pt-0.5 flex items-center gap-4'>
<div className='flex items-center gap-4 pt-0.5'>
<div className=''>
<div className='mb-0.5 text-text-tertiary system-2xs-medium-uppercase'>{t('appDebug.feature.annotation.scoreThreshold.title')}</div>
<div className='text-text-secondary system-xs-regular'>{annotationReply.score_threshold || '-'}</div>
<div className='system-2xs-medium-uppercase mb-0.5 text-text-tertiary'>{t('appDebug.feature.annotation.scoreThreshold.title')}</div>
<div className='system-xs-regular text-text-secondary'>{annotationReply.score_threshold || '-'}</div>
</div>
<div className='w-px h-[27px] bg-divider-subtle rotate-12'></div>
<div className='h-[27px] w-px rotate-12 bg-divider-subtle'></div>
<div className=''>
<div className='mb-0.5 text-text-tertiary system-2xs-medium-uppercase'>{t('common.modelProvider.embeddingModel.key')}</div>
<div className='text-text-secondary system-xs-regular'>{annotationReply.embedding_model?.embedding_model_name}</div>
<div className='system-2xs-medium-uppercase mb-0.5 text-text-tertiary'>{t('common.modelProvider.embeddingModel.key')}</div>
<div className='system-xs-regular text-text-secondary'>{annotationReply.embedding_model?.embedding_model_name}</div>
</div>
</div>
)}
{isHovering && (
<div className='flex items-center justify-between'>
<Button className='w-[178px]' onClick={() => setIsShowAnnotationConfigInit(true)} disabled={disabled}>
<RiEqualizer2Line className='mr-1 w-4 h-4' />
<RiEqualizer2Line className='mr-1 h-4 w-4' />
{t('common.operation.params')}
</Button>
<Button className='w-[178px]' onClick={() => {
router.push(`/app/${appId}/annotations`)
}}>
<RiExternalLinkLine className='mr-1 w-4 h-4' />
<RiExternalLinkLine className='mr-1 h-4 w-4' />
{t('appDebug.feature.annotation.cacheManagement')}
</Button>
</div>

View File

@@ -20,13 +20,13 @@ const Slider: React.FC<ISliderProps> = ({ className, max, min, step, value, disa
max={max || 100}
step={step || 1}
className={cn(className, s.slider)}
thumbClassName={cn(s['slider-thumb'], 'top-[-7px] w-2 h-[18px] bg-white border !border-black/8 rounded-[36px] shadow-md cursor-pointer')}
thumbClassName={cn(s['slider-thumb'], 'top-[-7px] h-[18px] w-2 cursor-pointer rounded-[36px] border !border-black/8 bg-white shadow-md')}
trackClassName={s['slider-track']}
onChange={onChange}
renderThumb={(props, state) => (
<div {...props}>
<div className='relative w-full h-full'>
<div className='absolute top-[-16px] left-[50%] translate-x-[-50%] system-sm-semibold text-text-primary'>
<div className='relative h-full w-full'>
<div className='system-sm-semibold absolute left-[50%] top-[-16px] translate-x-[-50%] text-text-primary'>
{(state.valueNow / 100).toFixed(2)}
</div>
</div>

View File

@@ -19,7 +19,7 @@ const ScoreSlider: FC<Props> = ({
return (
<div className={className}>
<div className='h-[1px] mt-[14px]'>
<div className='mt-[14px] h-[1px]'>
<Slider
max={100}
min={80}
@@ -28,7 +28,7 @@ const ScoreSlider: FC<Props> = ({
onChange={onChange}
/>
</div>
<div className='mt-[10px] flex justify-between items-center system-xs-semibold-uppercase'>
<div className='system-xs-semibold-uppercase mt-[10px] flex items-center justify-between'>
<div className='flex space-x-1 text-util-colors-cyan-cyan-500'>
<div>0.8</div>
<div>·</div>