mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
fix plugin detail panel display in tool list
This commit is contained in:
@ -17,10 +17,11 @@ import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
|
|||||||
import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
|
import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
|
||||||
import MCPList from './mcp'
|
import MCPList from './mcp'
|
||||||
import { useAllToolProviders } from '@/service/use-tools'
|
import { useAllToolProviders } from '@/service/use-tools'
|
||||||
import { useInstalledPluginList, useInvalidateInstalledPluginList } from '@/service/use-plugins'
|
import { useInvalidateInstalledPluginList, usePluginDeclarationFromMarketPlace } from '@/service/use-plugins'
|
||||||
import { useGlobalPublicStore } from '@/context/global-public-context'
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||||
import { ToolTypeEnum } from '../workflow/block-selector/types'
|
import { ToolTypeEnum } from '../workflow/block-selector/types'
|
||||||
import { useMarketplace } from './marketplace/hooks'
|
import { useMarketplace } from './marketplace/hooks'
|
||||||
|
import type { PluginDetail } from '@/app/components/plugins/types'
|
||||||
|
|
||||||
const getToolType = (type: string) => {
|
const getToolType = (type: string) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -77,12 +78,18 @@ const ProviderList = () => {
|
|||||||
const currentProvider = useMemo<Collection | undefined>(() => {
|
const currentProvider = useMemo<Collection | undefined>(() => {
|
||||||
return filteredCollectionList.find(collection => collection.id === currentProviderId)
|
return filteredCollectionList.find(collection => collection.id === currentProviderId)
|
||||||
}, [currentProviderId, filteredCollectionList])
|
}, [currentProviderId, filteredCollectionList])
|
||||||
const { data: pluginList } = useInstalledPluginList()
|
const { data: pluginDetail } = usePluginDeclarationFromMarketPlace(currentProvider?.plugin_unique_identifier || '')
|
||||||
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
|
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
|
||||||
const currentPluginDetail = useMemo(() => {
|
const currentPluginDetail = useMemo(() => {
|
||||||
const detail = pluginList?.plugins.find(plugin => plugin.plugin_id === currentProvider?.plugin_id)
|
if (!pluginDetail) return
|
||||||
return detail
|
const detail = {
|
||||||
}, [currentProvider?.plugin_id, pluginList?.plugins])
|
plugin_id: currentProvider?.plugin_id,
|
||||||
|
plugin_unique_identifier: currentProvider?.plugin_unique_identifier,
|
||||||
|
declaration: pluginDetail?.manifest,
|
||||||
|
tenant_id: currentProvider?.tenant_id,
|
||||||
|
}
|
||||||
|
return detail as PluginDetail
|
||||||
|
}, [currentProvider, pluginDetail])
|
||||||
|
|
||||||
const toolListTailRef = useRef<HTMLDivElement>(null)
|
const toolListTailRef = useRef<HTMLDivElement>(null)
|
||||||
const showMarketplacePanel = useCallback(() => {
|
const showMarketplacePanel = useCallback(() => {
|
||||||
|
|||||||
@ -53,6 +53,8 @@ export type Collection = {
|
|||||||
allow_delete: boolean
|
allow_delete: boolean
|
||||||
labels: string[]
|
labels: string[]
|
||||||
plugin_id?: string
|
plugin_id?: string
|
||||||
|
plugin_unique_identifier?: string
|
||||||
|
tenant_id?: string
|
||||||
letter?: string
|
letter?: string
|
||||||
// MCP Server
|
// MCP Server
|
||||||
server_url?: string
|
server_url?: string
|
||||||
|
|||||||
Reference in New Issue
Block a user