mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
node ui fix
This commit is contained in:
parent
2f5da1f6aa
commit
85610651c0
@ -24,8 +24,6 @@ import { InstallPluginButton } from '@/app/components/workflow/nodes/_base/compo
|
|||||||
import StatusIndicators from './status-indicators'
|
import StatusIndicators from './status-indicators'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
import { useProviderContext } from '@/context/provider-context'
|
import { useProviderContext } from '@/context/provider-context'
|
||||||
import { useModalContextSelector } from '@/context/modal-context'
|
|
||||||
import { useEventEmitterContextContext } from '@/context/event-emitter'
|
|
||||||
import { RiEqualizer2Line } from '@remixicon/react'
|
import { RiEqualizer2Line } from '@remixicon/react'
|
||||||
import { fetchPluginInfoFromMarketPlace } from '@/service/plugins'
|
import { fetchPluginInfoFromMarketPlace } from '@/service/plugins'
|
||||||
|
|
||||||
@ -51,10 +49,8 @@ const AgentModelTrigger: FC<AgentModelTriggerProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { modelProviders } = useProviderContext()
|
const { modelProviders } = useProviderContext()
|
||||||
const setShowModelModal = useModalContextSelector(state => state.setShowModelModal)
|
|
||||||
const updateModelProviders = useUpdateModelProviders()
|
const updateModelProviders = useUpdateModelProviders()
|
||||||
const updateModelList = useUpdateModelList()
|
const updateModelList = useUpdateModelList()
|
||||||
const { eventEmitter } = useEventEmitterContextContext()
|
|
||||||
const { modelProvider, needsConfiguration } = useMemo(() => {
|
const { modelProvider, needsConfiguration } = useMemo(() => {
|
||||||
const modelProvider = modelProviders.find(item => item.provider === providerName)
|
const modelProvider = modelProviders.find(item => item.provider === providerName)
|
||||||
const needsConfiguration = modelProvider?.custom_configuration.status === CustomConfigurationStatusEnum.noConfigure && !(
|
const needsConfiguration = modelProvider?.custom_configuration.status === CustomConfigurationStatusEnum.noConfigure && !(
|
||||||
|
|||||||
@ -34,7 +34,7 @@ const ModelTrigger: FC<ModelTriggerProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'group flex items-center p-1 h-6 gap-0.5 rounded-lg bg-components-input-bg-normal',
|
'group flex items-center p-1 h-8 gap-0.5 rounded-lg bg-components-input-bg-normal',
|
||||||
!readonly && 'hover:bg-components-input-bg-hover cursor-pointer',
|
!readonly && 'hover:bg-components-input-bg-hover cursor-pointer',
|
||||||
open && 'bg-components-input-bg-hover',
|
open && 'bg-components-input-bg-hover',
|
||||||
model.status !== ModelStatusEnum.active && 'bg-components-input-bg-disabled hover:bg-components-input-bg-disabled',
|
model.status !== ModelStatusEnum.active && 'bg-components-input-bg-disabled hover:bg-components-input-bg-disabled',
|
||||||
|
|||||||
@ -111,6 +111,7 @@ export type PluginDetail = {
|
|||||||
export type PluginInfoFromMarketPlace = {
|
export type PluginInfoFromMarketPlace = {
|
||||||
category: PluginType
|
category: PluginType
|
||||||
latest_package_identifier: string
|
latest_package_identifier: string
|
||||||
|
latest_version: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Plugin = {
|
export type Plugin = {
|
||||||
|
|||||||
@ -111,7 +111,7 @@ const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
|
|||||||
return <ModelSelector
|
return <ModelSelector
|
||||||
key={model.param}
|
key={model.param}
|
||||||
modelList={modelList}
|
modelList={modelList}
|
||||||
triggerClassName='bg-workflow-block-parma-bg'
|
triggerClassName='bg-workflow-block-parma-bg !h-6 !rounded-md'
|
||||||
defaultModel={
|
defaultModel={
|
||||||
'provider' in model
|
'provider' in model
|
||||||
? {
|
? {
|
||||||
|
|||||||
@ -25,6 +25,7 @@ const Node: FC<NodeProps<LLMNodeType>> = ({
|
|||||||
<ModelSelector
|
<ModelSelector
|
||||||
defaultModel={{ provider, model: modelId }}
|
defaultModel={{ provider, model: modelId }}
|
||||||
modelList={textGenerationModelList}
|
modelList={textGenerationModelList}
|
||||||
|
triggerClassName='!h-6 !rounded-md'
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ const Node: FC<NodeProps<ParameterExtractorNodeType>> = ({
|
|||||||
<ModelSelector
|
<ModelSelector
|
||||||
defaultModel={{ provider, model: modelId }}
|
defaultModel={{ provider, model: modelId }}
|
||||||
modelList={textGenerationModelList}
|
modelList={textGenerationModelList}
|
||||||
|
triggerClassName='!h-6 !rounded-md'
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -32,6 +32,7 @@ const Node: FC<NodeProps<QuestionClassifierNodeType>> = (props) => {
|
|||||||
{hasSetModel && (
|
{hasSetModel && (
|
||||||
<ModelSelector
|
<ModelSelector
|
||||||
defaultModel={{ provider, model: modelId }}
|
defaultModel={{ provider, model: modelId }}
|
||||||
|
triggerClassName='!h-6 !rounded-md'
|
||||||
modelList={textGenerationModelList}
|
modelList={textGenerationModelList}
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user