feat: new icons (#5412)

This commit is contained in:
zxhlyh
2024-06-20 11:05:08 +08:00
committed by GitHub
parent 0105129fa8
commit 2328ed8ffa
338 changed files with 880 additions and 3669 deletions

View File

@@ -3,10 +3,10 @@ import type { FC } from 'react'
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import cn from 'classnames'
import { RiCloseLine } from '@remixicon/react'
import { ArrowNarrowLeft } from '../../base/icons/src/vender/line/arrows'
import NodePanel from './node'
import type { NodeTracing } from '@/types/workflow'
import { XClose } from '@/app/components/base/icons/src/vender/line/general'
const i18nPrefix = 'workflow.singleRun'
type Props = {
@@ -32,7 +32,7 @@ const IterationResultPanel: FC<Props> = ({
{t(`${i18nPrefix}.testRunIteration`)}
</div>
<div className='ml-2 shrink-0 p-1 cursor-pointer' onClick={onHide}>
<XClose className='w-4 h-4 text-gray-500 ' />
<RiCloseLine className='w-4 h-4 text-gray-500 ' />
</div>
</div>
<div className='flex items-center py-2 space-x-1 text-primary-600 cursor-pointer' onClick={onBack}>

View File

@@ -3,14 +3,18 @@ import { useTranslation } from 'react-i18next'
import type { FC } from 'react'
import { useCallback, useEffect, useState } from 'react'
import cn from 'classnames'
import {
RiArrowRightSLine,
RiCheckboxCircleLine,
RiErrorWarningLine,
RiLoader2Line,
} from '@remixicon/react'
import BlockIcon from '../block-icon'
import { BlockEnum } from '../types'
import Split from '../nodes/_base/components/split'
import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor'
import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'
import { AlertCircle, AlertTriangle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import { CheckCircle, Loading02 } from '@/app/components/base/icons/src/vender/line/general'
import { ArrowNarrowRight, ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows'
import { AlertTriangle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import type { NodeTracing } from '@/types/workflow'
type Props = {
@@ -79,7 +83,7 @@ const NodePanel: FC<Props> = ({
onClick={() => setCollapseState(!collapseState)}
>
{!hideProcessDetail && (
<ChevronRight
<RiArrowRightSLine
className={cn(
'shrink-0 w-3 h-3 mr-1 text-gray-400 transition-all group-hover:text-gray-500',
!collapseState && 'rotate-90',
@@ -96,10 +100,10 @@ const NodePanel: FC<Props> = ({
<div className='shrink-0 text-gray-500 text-xs leading-[18px]'>{`${getTime(nodeInfo.elapsed_time || 0)} · ${getTokenCount(nodeInfo.execution_metadata?.total_tokens || 0)} tokens`}</div>
)}
{nodeInfo.status === 'succeeded' && (
<CheckCircle className='shrink-0 ml-2 w-3.5 h-3.5 text-[#12B76A]' />
<RiCheckboxCircleLine className='shrink-0 ml-2 w-3.5 h-3.5 text-[#12B76A]' />
)}
{nodeInfo.status === 'failed' && (
<AlertCircle className='shrink-0 ml-2 w-3.5 h-3.5 text-[#F04438]' />
<RiErrorWarningLine className='shrink-0 ml-2 w-3.5 h-3.5 text-[#F04438]' />
)}
{nodeInfo.status === 'stopped' && (
<AlertTriangle className='shrink-0 ml-2 w-3.5 h-3.5 text-[#F79009]' />
@@ -107,7 +111,7 @@ const NodePanel: FC<Props> = ({
{nodeInfo.status === 'running' && (
<div className='shrink-0 flex items-center text-primary-600 text-[13px] leading-[16px] font-medium'>
<span className='mr-2 text-xs font-normal'>Running</span>
<Loading02 className='w-3.5 h-3.5 animate-spin' />
<RiLoader2Line className='w-3.5 h-3.5 animate-spin' />
</div>
)}
</div>
@@ -122,12 +126,12 @@ const NodePanel: FC<Props> = ({
<div className='leading-[18px] text-[13px] font-medium text-gray-700'>{t('workflow.nodes.iteration.iteration', { count: nodeInfo.metadata?.iterator_length || (nodeInfo.execution_metadata?.steps_boundary?.length - 1) })}</div>
{justShowIterationNavArrow
? (
<ArrowNarrowRight className='w-3.5 h-3.5 text-gray-500' />
<RiArrowRightSLine className='w-3.5 h-3.5 text-gray-500' />
)
: (
<div className='flex items-center space-x-1 text-[#155EEF]'>
<div className='text-[13px] font-normal '>{t('workflow.common.viewDetailInTracingPanel')}</div>
<ArrowNarrowRight className='w-3.5 h-3.5' />
<RiArrowRightSLine className='w-3.5 h-3.5' />
</div>
)}
</div>