fix plugin detail panel display in tool list

This commit is contained in:
JzoNg 2025-09-29 11:22:48 +08:00
parent fc90a8fb32
commit 930fdc8fb4
2 changed files with 7 additions and 14 deletions

View File

@ -17,11 +17,10 @@ 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 { useInvalidateInstalledPluginList, usePluginDeclarationFromMarketPlace } from '@/service/use-plugins'
import { useCheckInstalled, useInvalidateInstalledPluginList } 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) {
@ -78,18 +77,14 @@ const ProviderList = () => {
const currentProvider = useMemo<Collection | undefined>(() => {
return filteredCollectionList.find(collection => collection.id === currentProviderId)
}, [currentProviderId, filteredCollectionList])
const { data: pluginDetail } = usePluginDeclarationFromMarketPlace(currentProvider?.plugin_unique_identifier || '')
const { data: checkedInstalledData } = useCheckInstalled({
pluginIds: currentProvider?.plugin_id ? [currentProvider.plugin_id] : [],
enabled: !!currentProvider?.plugin_id,
})
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
const currentPluginDetail = useMemo(() => {
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])
return checkedInstalledData?.plugins?.[0]
}, [checkedInstalledData])
const toolListTailRef = useRef<HTMLDivElement>(null)
const showMarketplacePanel = useCallback(() => {

View File

@ -53,8 +53,6 @@ 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