fix: make the status indicator component compatible with the switch plugin version component

pull/12560/head
Yi 1 year ago
parent 369e3eb97f
commit 87d7df3ed4

@ -45,20 +45,38 @@ const StatusIndicators = ({ needsConfiguration, modelProvider, inModelList, disa
{/* plugin installed and model is in model list but disabled */} {/* plugin installed and model is in model list but disabled */}
{/* plugin installed from github/local and model is not in model list */} {/* plugin installed from github/local and model is not in model list */}
{!needsConfiguration && modelProvider && disabled && ( {!needsConfiguration && modelProvider && disabled && (
<Tooltip <>
popupContent={inModelList ? t('workflow.nodes.agent.modelSelectorTooltips.deprecated') {inModelList ? (
: renderTooltipContent( <Tooltip
t('workflow.nodes.agent.modelNotSupport.title'), popupContent={t('workflow.nodes.agent.modelSelectorTooltips.deprecated')}
!pluginInfo ? t('workflow.nodes.agent.modelNotSupport.desc') : t('workflow.nodes.agent.modelNotSupport.descForVersionSwitch'), asChild={false}
!pluginInfo ? t('workflow.nodes.agent.linkToPlugin') : '', needsDelay={false}
!pluginInfo ? '/plugins' : '', >
) <RiErrorWarningFill className='w-4 h-4 text-text-destructive' />
} </Tooltip>
asChild={false} ) : !pluginInfo ? (
needsDelay={!inModelList} <Tooltip
> popupContent={renderTooltipContent(
{!pluginInfo ? <RiErrorWarningFill className='w-4 h-4 text-text-destructive' /> : <SwitchPluginVersion uniqueIdentifier={pluginList?.plugins.find(plugin => plugin.name === pluginInfo.name)?.plugin_unique_identifier ?? ''} />} t('workflow.nodes.agent.modelNotSupport.title'),
</Tooltip> t('workflow.nodes.agent.modelNotSupport.desc'),
t('workflow.nodes.agent.linkToPlugin'),
'/plugins',
)}
asChild={false}
needsDelay={true}
>
<RiErrorWarningFill className='w-4 h-4 text-text-destructive' />
</Tooltip>
) : (
<SwitchPluginVersion
tooltip={renderTooltipContent(
t('workflow.nodes.agent.modelNotSupport.title'),
t('workflow.nodes.agent.modelNotSupport.descForVersionSwitch'),
)}
uniqueIdentifier={pluginList?.plugins.find(plugin => plugin.name === pluginInfo.name)?.plugin_unique_identifier ?? ''}
/>
)}
</>
)} )}
{!modelProvider && !pluginInfo && ( {!modelProvider && !pluginInfo && (
<Tooltip <Tooltip

@ -61,7 +61,7 @@ export const SwitchPluginVersion: FC<SwitchPluginVersionProps> = (props) => {
} }
const { t } = useTranslation() const { t } = useTranslation()
return <Tooltip popupContent={!isShow && !isShowUpdateModal && tooltip} triggerMethod='hover'> return <Tooltip popupContent={!isShow && !isShowUpdateModal && tooltip} triggerMethod='hover'>
<div className={cn('w-fit flex items-center justify-center', className)}> <div className={cn('w-fit flex items-center justify-center', className)} onClick={e => e.stopPropagation()}>
{isShowUpdateModal && pluginDetail && <PluginMutationModel {isShowUpdateModal && pluginDetail && <PluginMutationModel
onCancel={hideUpdateModal} onCancel={hideUpdateModal}
plugin={pluginManifestToCardPluginProps({ plugin={pluginManifestToCardPluginProps({

Loading…
Cancel
Save