refactor: some field name in strategy status

This commit is contained in:
AkaraChen
2025-01-07 09:30:35 +08:00
parent 61d2f70927
commit 15f3e46c49
6 changed files with 115 additions and 11 deletions

View File

@ -89,9 +89,9 @@ const AgentNode: FC<NodeProps<AgentNodeType>> = (props) => {
{inputs.agent_strategy_name
? <SettingItem
label={t('workflow.nodes.agent.strategy.shortLabel')}
status={currentStrategyStatus?.strategy === 'not-found' ? 'error' : undefined}
status={!currentStrategyStatus?.isExistInPlugin ? 'error' : undefined}
tooltip={
currentStrategyStatus?.strategy === 'not-found' ? t('workflow.nodes.agent.strategyNotInstallTooltip', {
!currentStrategyStatus?.isExistInPlugin ? t('workflow.nodes.agent.strategyNotInstallTooltip', {
plugin: pluginDetail?.declaration.label
? renderI18nObject(pluginDetail?.declaration.label)
: undefined,

View File

@ -18,7 +18,7 @@ export type StrategyStatus = {
source: 'external' | 'marketplace'
installed: boolean
}
strategy: 'not-found' | 'normal'
isExistInPlugin: boolean
}
export const useStrategyInfo = (
@ -46,7 +46,7 @@ export const useStrategyInfo = (
source: isInMarketplace ? 'marketplace' : 'external',
installed: isPluginInstalled,
},
strategy: strategyExist ? 'normal' : 'not-found',
isExistInPlugin: strategyExist,
}
}, [strategy, marketplace, strategyProvider.isError, strategyProvider.isLoading])
return {