mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
Revert "chore: remove switch version component in strategy select"
This reverts commit f63cc9e069.
This commit is contained in:
parent
fdfe724438
commit
5e4d2f9501
@ -17,8 +17,10 @@ import type { ToolWithProvider } from '../../../types'
|
|||||||
import { CollectionType } from '@/app/components/tools/types'
|
import { CollectionType } from '@/app/components/tools/types'
|
||||||
import useGetIcon from '@/app/components/plugins/install-plugin/base/use-get-icon'
|
import useGetIcon from '@/app/components/plugins/install-plugin/base/use-get-icon'
|
||||||
import { useStrategyInfo } from '../../agent/use-config'
|
import { useStrategyInfo } from '../../agent/use-config'
|
||||||
|
import { SwitchPluginVersion } from './switch-plugin-version'
|
||||||
import PluginList from '@/app/components/workflow/block-selector/market-place-plugin/list'
|
import PluginList from '@/app/components/workflow/block-selector/market-place-plugin/list'
|
||||||
import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/hooks'
|
import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/hooks'
|
||||||
|
import { ToolTipContent } from '@/app/components/base/tooltip/content'
|
||||||
|
|
||||||
const NotFoundWarn = (props: {
|
const NotFoundWarn = (props: {
|
||||||
title: ReactNode,
|
title: ReactNode,
|
||||||
@ -102,14 +104,15 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
|
|||||||
value?.agent_strategy_name,
|
value?.agent_strategy_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
// plugin not found and is not found in marketplace
|
const showPluginNotInstalledWarn = strategyStatus?.plugin?.source === 'external'
|
||||||
const showPluginNotInstalledWarn = !strategyStatus?.isExistInPlugin && strategyStatus?.plugin?.source === 'external'
|
|
||||||
&& !strategyStatus.plugin.installed
|
&& !strategyStatus.plugin.installed
|
||||||
|
|
||||||
// strategy not found
|
const showUnsupportedStrategy = strategyStatus?.plugin.source === 'external'
|
||||||
const showUnsupportedStrategy = !strategyStatus?.isExistInPlugin
|
&& !strategyStatus?.isExistInPlugin
|
||||||
|
|
||||||
|
const showSwitchVersion = !strategyStatus?.isExistInPlugin
|
||||||
|
&& strategyStatus?.plugin.source === 'marketplace' && strategyStatus.plugin.installed
|
||||||
|
|
||||||
// plugin not found and is founded in marketplace
|
|
||||||
const showInstallButton = !strategyStatus?.isExistInPlugin
|
const showInstallButton = !strategyStatus?.isExistInPlugin
|
||||||
&& strategyStatus?.plugin.source === 'marketplace' && !strategyStatus.plugin.installed
|
&& strategyStatus?.plugin.source === 'marketplace' && !strategyStatus.plugin.installed
|
||||||
|
|
||||||
@ -174,6 +177,16 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) =>
|
|||||||
/>
|
/>
|
||||||
: <RiArrowDownSLine className='size-4 text-text-tertiary' />
|
: <RiArrowDownSLine className='size-4 text-text-tertiary' />
|
||||||
}
|
}
|
||||||
|
{showSwitchVersion && <SwitchPluginVersion
|
||||||
|
uniqueIdentifier={'langgenius/openai:12'}
|
||||||
|
tooltip={<ToolTipContent
|
||||||
|
title={t('workflow.nodes.agent.unsupportedStrategy')}>
|
||||||
|
{t('workflow.nodes.agent.strategyNotFoundDescAndSwitchVersion')}
|
||||||
|
</ToolTipContent>}
|
||||||
|
onChange={() => {
|
||||||
|
// TODO: refresh all strategies
|
||||||
|
}}
|
||||||
|
/>}
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
</PortalToFollowElemTrigger>
|
</PortalToFollowElemTrigger>
|
||||||
|
|||||||
@ -740,6 +740,7 @@ const translation = {
|
|||||||
unsupportedStrategy: 'Unsupported strategy',
|
unsupportedStrategy: 'Unsupported strategy',
|
||||||
pluginNotFoundDesc: 'This plugin is installed from GitHub. Please go to Plugins to reinstall',
|
pluginNotFoundDesc: 'This plugin is installed from GitHub. Please go to Plugins to reinstall',
|
||||||
strategyNotFoundDesc: 'The installed plugin version does not provide this strategy.',
|
strategyNotFoundDesc: 'The installed plugin version does not provide this strategy.',
|
||||||
|
strategyNotFoundDescAndSwitchVersion: 'The installed plugin version does not provide this strategy. Click to switch version.',
|
||||||
modelSelectorTooltips: {
|
modelSelectorTooltips: {
|
||||||
deprecated: 'This model is deprecated',
|
deprecated: 'This model is deprecated',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -740,6 +740,7 @@ const translation = {
|
|||||||
unsupportedStrategy: '不支持的策略',
|
unsupportedStrategy: '不支持的策略',
|
||||||
strategyNotFoundDesc: '安装的插件版本不提供此策略。',
|
strategyNotFoundDesc: '安装的插件版本不提供此策略。',
|
||||||
pluginNotFoundDesc: '此插件安装自 GitHub。请转到插件重新安装。',
|
pluginNotFoundDesc: '此插件安装自 GitHub。请转到插件重新安装。',
|
||||||
|
strategyNotFoundDescAndSwitchVersion: '安装的插件版本不提供此策略。点击切换版本。',
|
||||||
modelSelectorTooltips: {
|
modelSelectorTooltips: {
|
||||||
deprecated: '此模型已弃用',
|
deprecated: '此模型已弃用',
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user