Files
dify/web/app/components/workflow/nodes/data-source/node.tsx
yyh bbe975c6bc feat: enhance model plugin workflow checks and model provider management UX (#33289)
Signed-off-by: yyh <yuanyouhuilyz@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Coding On Star <447357187@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: statxc <tyleradams93226@gmail.com>
2026-03-18 10:16:15 +08:00

43 lines
1.2 KiB
TypeScript

import type { FC } from 'react'
import type { DataSourceNodeType } from './types'
import type { NodeProps } from '@/app/components/workflow/types'
import { memo } from 'react'
import { useNodePluginInstallation } from '@/app/components/workflow/hooks/use-node-plugin-installation'
import { InstallPluginButton } from '@/app/components/workflow/nodes/_base/components/install-plugin-button'
const Node: FC<NodeProps<DataSourceNodeType>> = ({
data,
}) => {
const {
isChecking,
isMissing,
uniqueIdentifier,
canInstall,
onInstallSuccess,
} = useNodePluginInstallation(data)
const showInstallButton = !isChecking && isMissing && canInstall && uniqueIdentifier
if (!showInstallButton)
return null
return (
<div className="relative mb-1 px-3 py-1">
<div className="pointer-events-auto absolute right-3 top-[-32px] z-40">
<InstallPluginButton
size="small"
extraIdentifiers={[
data.plugin_id,
data.provider_name,
].filter(Boolean) as string[]}
className="!font-medium !text-text-accent"
uniqueIdentifier={uniqueIdentifier!}
onSuccess={onInstallSuccess}
/>
</div>
</div>
)
}
export default memo(Node)