mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
chore(web): new lint setup (#30020)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import type { currentVarType } from './panel'
|
||||
import type { NodeWithVar, VarInInspect } from '@/types/workflow'
|
||||
import {
|
||||
RiArrowRightSLine,
|
||||
RiDeleteBinLine,
|
||||
@ -7,16 +7,16 @@ import {
|
||||
RiLoader2Line,
|
||||
// RiErrorWarningFill,
|
||||
} from '@remixicon/react'
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
// import Button from '@/app/components/base/button'
|
||||
import ActionButton from '@/app/components/base/action-button'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
import BlockIcon from '@/app/components/workflow/block-icon'
|
||||
import type { currentVarType } from './panel'
|
||||
import { VariableIconWithColor } from '@/app/components/workflow/nodes/_base/components/variable/variable-label'
|
||||
import { VarInInspectType } from '@/types/workflow'
|
||||
import type { NodeWithVar, VarInInspect } from '@/types/workflow'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { useToolIcon } from '../hooks'
|
||||
import { VariableIconWithColor } from '@/app/components/workflow/nodes/_base/components/variable/variable-label'
|
||||
|
||||
type Props = {
|
||||
nodeData?: NodeWithVar
|
||||
@ -86,7 +86,8 @@ const Group = ({
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!nodeData) return
|
||||
if (!nodeData)
|
||||
return
|
||||
handleSelect({
|
||||
nodeId: nodeData.nodeId,
|
||||
nodeType: nodeData.nodeType,
|
||||
@ -96,31 +97,31 @@ const Group = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='p-0.5'>
|
||||
<div className="p-0.5">
|
||||
{/* node item */}
|
||||
<div className='group flex h-6 items-center gap-0.5'>
|
||||
<div className='h-3 w-3 shrink-0'>
|
||||
<div className="group flex h-6 items-center gap-0.5">
|
||||
<div className="h-3 w-3 shrink-0">
|
||||
{nodeData?.isSingRunRunning && (
|
||||
<RiLoader2Line className='h-3 w-3 animate-spin text-text-accent' />
|
||||
<RiLoader2Line className="h-3 w-3 animate-spin text-text-accent" />
|
||||
)}
|
||||
{(!nodeData || !nodeData.isSingRunRunning) && visibleVarList.length > 0 && (
|
||||
<RiArrowRightSLine className={cn('h-3 w-3 text-text-tertiary', !isCollapsed && 'rotate-90')} onClick={() => setIsCollapsed(!isCollapsed)} />
|
||||
)}
|
||||
</div>
|
||||
<div className='flex grow cursor-pointer items-center gap-1' onClick={() => setIsCollapsed(!isCollapsed)}>
|
||||
<div className="flex grow cursor-pointer items-center gap-1" onClick={() => setIsCollapsed(!isCollapsed)}>
|
||||
{nodeData && (
|
||||
<>
|
||||
<BlockIcon
|
||||
className='shrink-0'
|
||||
className="shrink-0"
|
||||
type={nodeData.nodeType}
|
||||
toolIcon={toolIcon || ''}
|
||||
size='xs'
|
||||
size="xs"
|
||||
/>
|
||||
<div className='system-xs-medium-uppercase truncate text-text-tertiary'>{nodeData.title}</div>
|
||||
<div className="system-xs-medium-uppercase truncate text-text-tertiary">{nodeData.title}</div>
|
||||
</>
|
||||
)}
|
||||
{!nodeData && (
|
||||
<div className='system-xs-medium-uppercase truncate text-text-tertiary'>
|
||||
<div className="system-xs-medium-uppercase truncate text-text-tertiary">
|
||||
{isEnv && t('workflow.debug.variableInspect.envNode')}
|
||||
{isChatVar && t('workflow.debug.variableInspect.chatNode')}
|
||||
{isSystem && t('workflow.debug.variableInspect.systemNode')}
|
||||
@ -128,15 +129,15 @@ const Group = ({
|
||||
)}
|
||||
</div>
|
||||
{nodeData && !nodeData.isSingRunRunning && (
|
||||
<div className='hidden shrink-0 items-center group-hover:flex'>
|
||||
<div className="hidden shrink-0 items-center group-hover:flex">
|
||||
<Tooltip popupContent={t('workflow.debug.variableInspect.view')}>
|
||||
<ActionButton onClick={handleView}>
|
||||
<RiFileList3Line className='h-4 w-4' />
|
||||
<RiFileList3Line className="h-4 w-4" />
|
||||
</ActionButton>
|
||||
</Tooltip>
|
||||
<Tooltip popupContent={t('workflow.debug.variableInspect.clearNode')}>
|
||||
<ActionButton onClick={handleClear}>
|
||||
<RiDeleteBinLine className='h-4 w-4' />
|
||||
<RiDeleteBinLine className="h-4 w-4" />
|
||||
</ActionButton>
|
||||
</Tooltip>
|
||||
</div>
|
||||
@ -144,7 +145,7 @@ const Group = ({
|
||||
</div>
|
||||
{/* var item list */}
|
||||
{!isCollapsed && !nodeData?.isSingRunRunning && (
|
||||
<div className='px-0.5'>
|
||||
<div className="px-0.5">
|
||||
{visibleVarList.length > 0 && visibleVarList.map(varItem => (
|
||||
<div
|
||||
key={varItem.id}
|
||||
@ -157,10 +158,10 @@ const Group = ({
|
||||
<VariableIconWithColor
|
||||
variableCategory={varType}
|
||||
isExceptionVariable={['error_type', 'error_message'].includes(varItem.name)}
|
||||
className='size-4'
|
||||
className="size-4"
|
||||
/>
|
||||
<div className='system-sm-medium grow truncate text-text-secondary'>{varItem.name}</div>
|
||||
<div className='system-xs-regular shrink-0 text-text-tertiary'>{varItem.value_type}</div>
|
||||
<div className="system-sm-medium grow truncate text-text-secondary">{varItem.name}</div>
|
||||
<div className="system-xs-regular shrink-0 text-text-tertiary">{varItem.value_type}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user