mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-15 13:56:53 +08:00
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:
@@ -474,21 +474,21 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
const renderResWrap = (
|
||||
<div
|
||||
className={cn(
|
||||
'relative flex flex-col h-full',
|
||||
'relative flex h-full flex-col',
|
||||
!isPC && 'h-[calc(100vh_-_36px)] rounded-t-2xl shadow-lg backdrop-blur-sm',
|
||||
!isPC
|
||||
? isShowResultPanel
|
||||
? 'bg-background-default-burn'
|
||||
: 'bg-components-panel-bg border-t-[0.5px] border-divider-regular'
|
||||
: 'border-t-[0.5px] border-divider-regular bg-components-panel-bg'
|
||||
: 'bg-chatbot-bg',
|
||||
)}
|
||||
>
|
||||
{isCallBatchAPI && (
|
||||
<div className={cn(
|
||||
'shrink-0 px-14 pt-9 pb-2 flex items-center justify-between',
|
||||
!isPC && 'px-4 pt-3 pb-1',
|
||||
'flex shrink-0 items-center justify-between px-14 pb-2 pt-9',
|
||||
!isPC && 'px-4 pb-1 pt-3',
|
||||
)}>
|
||||
<div className='text-text-primary system-md-semibold-uppercase'>{t('share.generation.executions', { num: allTaskList.length })}</div>
|
||||
<div className='system-md-semibold-uppercase text-text-primary'>{t('share.generation.executions', { num: allTaskList.length })}</div>
|
||||
{allSuccessTaskList.length > 0 && (
|
||||
<ResDownload
|
||||
isMobile={!isPC}
|
||||
@@ -498,7 +498,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
</div>
|
||||
)}
|
||||
<div className={cn(
|
||||
'grow flex flex-col h-0 overflow-y-auto',
|
||||
'flex h-0 grow flex-col overflow-y-auto',
|
||||
isPC && 'px-14 py-8',
|
||||
isPC && isCallBatchAPI && 'pt-0',
|
||||
!isPC && 'p-0 pb-2',
|
||||
@@ -511,11 +511,11 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
)}
|
||||
</div>
|
||||
{isCallBatchAPI && allFailedTaskList.length > 0 && (
|
||||
<div className='z-10 absolute bottom-6 left-1/2 -translate-x-1/2 flex items-center gap-2 p-3 rounded-xl bg-components-panel-bg-blur backdrop-blur-sm border border-components-panel-border shadow-lg'>
|
||||
<RiErrorWarningFill className='w-4 h-4 text-text-destructive' />
|
||||
<div className='text-text-secondary system-sm-medium'>{t('share.generation.batchFailed.info', { num: allFailedTaskList.length })}</div>
|
||||
<div className='w-px h-3.5 bg-divider-regular'></div>
|
||||
<div onClick={handleRetryAllFailedTask} className='text-text-accent system-sm-semibold-uppercase cursor-pointer'>{t('share.generation.batchFailed.retry')}</div>
|
||||
<div className='absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 items-center gap-2 rounded-xl border border-components-panel-border bg-components-panel-bg-blur p-3 shadow-lg backdrop-blur-sm'>
|
||||
<RiErrorWarningFill className='h-4 w-4 text-text-destructive' />
|
||||
<div className='system-sm-medium text-text-secondary'>{t('share.generation.batchFailed.info', { num: allFailedTaskList.length })}</div>
|
||||
<div className='h-3.5 w-px bg-divider-regular'></div>
|
||||
<div onClick={handleRetryAllFailedTask} className='system-sm-semibold-uppercase cursor-pointer text-text-accent'>{t('share.generation.batchFailed.retry')}</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -523,7 +523,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
|
||||
if (!appId || !siteInfo || !promptConfig) {
|
||||
return (
|
||||
<div className='flex items-center h-screen'>
|
||||
<div className='flex h-screen items-center'>
|
||||
<Loading type='app' />
|
||||
</div>)
|
||||
}
|
||||
@@ -537,12 +537,12 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
)}>
|
||||
{/* Left */}
|
||||
<div className={cn(
|
||||
'shrink-0 relative flex flex-col h-full',
|
||||
'relative flex h-full shrink-0 flex-col',
|
||||
isPC ? 'w-[600px] max-w-[50%]' : resultExisted ? 'h-[calc(100%_-_64px)]' : '',
|
||||
isInstalledApp && 'rounded-l-2xl',
|
||||
)}>
|
||||
{/* header */}
|
||||
<div className={cn('shrink-0 space-y-4 border-b border-divider-subtle', isPC ? 'p-8 pb-0 bg-components-panel-bg' : 'p-4 pb-0')}>
|
||||
<div className={cn('shrink-0 space-y-4 border-b border-divider-subtle', isPC ? 'bg-components-panel-bg p-8 pb-0' : 'p-4 pb-0')}>
|
||||
<div className='flex items-center gap-3'>
|
||||
<AppIcon
|
||||
size={isPC ? 'large' : 'small'}
|
||||
@@ -551,7 +551,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
background={siteInfo.icon_background || appDefaultIconBackground}
|
||||
imageUrl={siteInfo.icon_url}
|
||||
/>
|
||||
<div className='grow text-text-secondary system-md-semibold truncate'>{siteInfo.title}</div>
|
||||
<div className='system-md-semibold grow truncate text-text-secondary'>{siteInfo.title}</div>
|
||||
<MenuDropdown data={siteInfo} />
|
||||
</div>
|
||||
{siteInfo.description && (
|
||||
@@ -566,7 +566,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
id: 'saved',
|
||||
name: t('share.generation.tabs.saved'),
|
||||
isRight: true,
|
||||
icon: <RiBookmark3Line className='w-4 h-4' />,
|
||||
icon: <RiBookmark3Line className='h-4 w-4' />,
|
||||
extra: savedMessages.length > 0
|
||||
? (
|
||||
<Badge className='ml-1'>
|
||||
@@ -583,7 +583,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
</div>
|
||||
{/* form */}
|
||||
<div className={cn(
|
||||
'grow h-0 bg-components-panel-bg overflow-y-auto',
|
||||
'h-0 grow overflow-y-auto bg-components-panel-bg',
|
||||
isPC ? 'px-8' : 'px-4',
|
||||
!isPC && resultExisted && customConfig?.remove_webapp_brand && 'rounded-b-2xl border-b-[0.5px] border-divider-regular',
|
||||
)}>
|
||||
@@ -619,13 +619,13 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
{/* powered by */}
|
||||
{!customConfig?.remove_webapp_brand && (
|
||||
<div className={cn(
|
||||
'shrink-0 py-3 flex items-center gap-1.5 bg-components-panel-bg',
|
||||
'flex shrink-0 items-center gap-1.5 bg-components-panel-bg py-3',
|
||||
isPC ? 'px-8' : 'px-4',
|
||||
!isPC && resultExisted && 'rounded-b-2xl border-b-[0.5px] border-divider-regular',
|
||||
)}>
|
||||
<div className='text-text-tertiary system-2xs-medium-uppercase'>{t('share.chat.poweredBy')}</div>
|
||||
<div className='system-2xs-medium-uppercase text-text-tertiary'>{t('share.chat.poweredBy')}</div>
|
||||
{customConfig?.replace_webapp_logo && (
|
||||
<img src={customConfig?.replace_webapp_logo} alt='logo' className='block w-auto h-5' />
|
||||
<img src={customConfig?.replace_webapp_logo} alt='logo' className='block h-5 w-auto' />
|
||||
)}
|
||||
{!customConfig?.replace_webapp_logo && (
|
||||
<LogoSite className='!h-5' />
|
||||
@@ -636,19 +636,19 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
{/* Result */}
|
||||
<div className={cn(
|
||||
isPC
|
||||
? 'grow h-full'
|
||||
? 'h-full grow'
|
||||
: isShowResultPanel
|
||||
? 'fixed z-50 inset-0 bg-background-overlay backdrop-blur-sm'
|
||||
? 'fixed inset-0 z-50 bg-background-overlay backdrop-blur-sm'
|
||||
: resultExisted
|
||||
? 'relative shrink-0 h-16 pt-2.5 bg-background-default-burn overflow-hidden'
|
||||
? 'relative h-16 shrink-0 overflow-hidden bg-background-default-burn pt-2.5'
|
||||
: '',
|
||||
)}>
|
||||
{!isPC && (
|
||||
<div
|
||||
className={cn(
|
||||
isShowResultPanel
|
||||
? 'p-2 pt-6 flex items-center justify-center'
|
||||
: 'z-10 absolute top-0 left-0 w-full px-2 pt-[3px] pb-[57px] flex items-center justify-center',
|
||||
? 'flex items-center justify-center p-2 pt-6'
|
||||
: 'absolute left-0 top-0 z-10 flex w-full items-center justify-center px-2 pb-[57px] pt-[3px]',
|
||||
)}
|
||||
onClick={() => {
|
||||
if (isShowResultPanel)
|
||||
@@ -657,7 +657,7 @@ const TextGeneration: FC<IMainProps> = ({
|
||||
showResultPanel()
|
||||
}}
|
||||
>
|
||||
<div className='w-8 h-1 rounded bg-divider-solid cursor-grab'/>
|
||||
<div className='h-1 w-8 cursor-grab rounded bg-divider-solid'/>
|
||||
</div>
|
||||
)}
|
||||
{renderResWrap}
|
||||
|
||||
Reference in New Issue
Block a user