Feat/attachments (#9526)
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: JzoNg <jzongcode@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import type { FC } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import cn from '@/utils/classnames'
|
||||
import Indicator from '@/app/components/header/indicator'
|
||||
import StatusContainer from '@/app/components/workflow/run/status-container'
|
||||
|
||||
type ResultProps = {
|
||||
status: string
|
||||
@@ -20,29 +21,24 @@ const StatusPanel: FC<ResultProps> = ({
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'px-3 py-[10px] rounded-lg border-[0.5px] border-[rbga(0,0,0,0.05)] shadow-xs',
|
||||
status === 'running' && '!bg-primary-50',
|
||||
status === 'succeeded' && '!bg-[#ecfdf3]',
|
||||
status === 'failed' && '!bg-[#fef3f2]',
|
||||
status === 'stopped' && '!bg-[#fffaeb]',
|
||||
)}
|
||||
>
|
||||
<StatusContainer status={status}>
|
||||
<div className='flex'>
|
||||
<div className='flex-[33%] max-w-[120px]'>
|
||||
<div className='text-xs leading-[18px] font-medium text-gray-400'>{t('runLog.resultPanel.status')}</div>
|
||||
<div className='mb-1 text-text-tertiary system-2xs-medium-uppercase'>{t('runLog.resultPanel.status')}</div>
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center gap-1 h-[18px] text-xs leading-3 font-semibold',
|
||||
status === 'running' && '!text-primary-600',
|
||||
status === 'succeeded' && '!text-[#039855]',
|
||||
status === 'failed' && '!text-[#d92d20]',
|
||||
status === 'stopped' && '!text-[#f79009]',
|
||||
'flex items-center gap-1 system-xs-semibold-uppercase',
|
||||
status === 'succeeded' && 'text-util-colors-green-green-600',
|
||||
status === 'failed' && 'text-util-colors-red-red-600',
|
||||
status === 'stopped' && 'text-util-colors-warning-warning-600',
|
||||
status === 'running' && 'text-util-colors-blue-light-blue-light-600',
|
||||
)}
|
||||
>
|
||||
{status === 'running' && (
|
||||
<span>Running</span>
|
||||
<>
|
||||
<Indicator color={'blue'} />
|
||||
<span>Running</span>
|
||||
</>
|
||||
)}
|
||||
{status === 'succeeded' && (
|
||||
<>
|
||||
@@ -65,10 +61,10 @@ const StatusPanel: FC<ResultProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex-[33%] max-w-[152px]'>
|
||||
<div className='text-xs leading-[18px] font-medium text-gray-400'>{t('runLog.resultPanel.time')}</div>
|
||||
<div className='flex items-center gap-1 h-[18px] text-gray-700 text-xs leading-3 font-semibold'>
|
||||
<div className='mb-1 text-text-tertiary system-2xs-medium-uppercase'>{t('runLog.resultPanel.time')}</div>
|
||||
<div className='flex items-center gap-1 system-sm-medium text-text-secondary'>
|
||||
{status === 'running' && (
|
||||
<div className='w-16 h-2 rounded-sm bg-[rgba(0,0,0,0.05)]' />
|
||||
<div className='w-16 h-2 rounded-sm bg-text-quaternary' />
|
||||
)}
|
||||
{status !== 'running' && (
|
||||
<span>{time ? `${time?.toFixed(3)}s` : '-'}</span>
|
||||
@@ -76,10 +72,10 @@ const StatusPanel: FC<ResultProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex-[33%]'>
|
||||
<div className='text-xs leading-[18px] font-medium text-gray-400'>{t('runLog.resultPanel.tokens')}</div>
|
||||
<div className='flex items-center gap-1 h-[18px] text-gray-700 text-xs leading-3 font-semibold'>
|
||||
<div className='mb-1 text-text-tertiary system-2xs-medium-uppercase'>{t('runLog.resultPanel.tokens')}</div>
|
||||
<div className='flex items-center gap-1 system-sm-medium text-text-secondary'>
|
||||
{status === 'running' && (
|
||||
<div className='w-20 h-2 rounded-sm bg-[rgba(0,0,0,0.05)]' />
|
||||
<div className='w-20 h-2 rounded-sm bg-text-quaternary' />
|
||||
)}
|
||||
{status !== 'running' && (
|
||||
<span>{`${tokens || 0} Tokens`}</span>
|
||||
@@ -89,11 +85,11 @@ const StatusPanel: FC<ResultProps> = ({
|
||||
</div>
|
||||
{status === 'failed' && error && (
|
||||
<>
|
||||
<div className='my-2 h-[0.5px] bg-black opacity-5' />
|
||||
<div className='text-xs leading-[18px] text-[#d92d20]'>{error}</div>
|
||||
<div className='my-2 h-[0.5px] bg-divider-subtle'/>
|
||||
<div className='system-xs-regular text-text-destructive'>{error}</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</StatusContainer>
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user