fix plugin detail panel display in tool list

This commit is contained in:
JzoNg 2025-09-29 10:43:57 +08:00
parent 80cb85b845
commit fc90a8fb32
2 changed files with 14 additions and 5 deletions

View File

@ -17,10 +17,11 @@ import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
import MCPList from './mcp'
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 { ToolTypeEnum } from '../workflow/block-selector/types'
import { useMarketplace } from './marketplace/hooks'
import type { PluginDetail } from '@/app/components/plugins/types'
const getToolType = (type: string) => {
switch (type) {
@ -77,12 +78,18 @@ const ProviderList = () => {
const currentProvider = useMemo<Collection | undefined>(() => {
return filteredCollectionList.find(collection => collection.id === currentProviderId)
}, [currentProviderId, filteredCollectionList])
const { data: pluginList } = useInstalledPluginList()
const { data: pluginDetail } = usePluginDeclarationFromMarketPlace(currentProvider?.plugin_unique_identifier || '')
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
const currentPluginDetail = useMemo(() => {
const detail = pluginList?.plugins.find(plugin => plugin.plugin_id === currentProvider?.plugin_id)
return detail
}, [currentProvider?.plugin_id, pluginList?.plugins])
if (!pluginDetail) return
const detail = {
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 showMarketplacePanel = useCallback(() => {

View File

@ -53,6 +53,8 @@ export type Collection = {
allow_delete: boolean
labels: string[]
plugin_id?: string
plugin_unique_identifier?: string
tenant_id?: string
letter?: string
// MCP Server
server_url?: string