mirror of https://github.com/langgenius/dify.git
feat: system var icon
This commit is contained in:
parent
5e2d5f0d83
commit
564bb22d8b
|
|
@ -187,6 +187,7 @@ const Item: FC<ItemProps> = ({
|
|||
>
|
||||
<div className='flex w-0 grow items-center'>
|
||||
{!isFlat && <VariableIconWithColor
|
||||
variables={itemData.variable.split('.')}
|
||||
variableCategory={variableCategory}
|
||||
isExceptionVariable={isException}
|
||||
/>}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { useMemo } from 'react'
|
||||
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
|
||||
import { BubbleX, Env } from '@/app/components/base/icons/src/vender/line/others'
|
||||
import { BubbleX, Env, GlobalVariable } from '@/app/components/base/icons/src/vender/line/others'
|
||||
import { Loop } from '@/app/components/base/icons/src/vender/workflow'
|
||||
import { InputField } from '@/app/components/base/icons/src/vender/pipeline'
|
||||
import {
|
||||
isConversationVar,
|
||||
isENV,
|
||||
isGlobalVar,
|
||||
isRagVariableVar,
|
||||
isSystemVar,
|
||||
} from '../utils'
|
||||
|
|
@ -24,6 +25,9 @@ export const useVarIcon = (variables: string[], variableCategory?: VarInInspectT
|
|||
if (isConversationVar(variables) || variableCategory === VarInInspectType.conversation || variableCategory === 'conversation')
|
||||
return BubbleX
|
||||
|
||||
if(isGlobalVar(variables))
|
||||
return GlobalVariable
|
||||
|
||||
return Variable02
|
||||
}
|
||||
|
||||
|
|
@ -41,6 +45,9 @@ export const useVarColor = (variables: string[], isExceptionVariable?: boolean,
|
|||
if (isConversationVar(variables) || variableCategory === VarInInspectType.conversation || variableCategory === 'conversation')
|
||||
return 'text-util-colors-teal-teal-700'
|
||||
|
||||
if (isGlobalVar(variables))
|
||||
return 'text-util-colors-orange-orange-600'
|
||||
|
||||
return 'text-text-accent'
|
||||
}, [variables, isExceptionVariable])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue