mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 17:45:57 +08:00
mcp list
This commit is contained in:
parent
3258a91d5d
commit
4123c0a960
20
web/app/components/tools/mcp/index.tsx
Normal file
20
web/app/components/tools/mcp/index.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
'use client'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
searchText: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const MCPList = ({
|
||||||
|
searchText,
|
||||||
|
}: Props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div>
|
||||||
|
MCP
|
||||||
|
{searchText}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default MCPList
|
@ -15,6 +15,7 @@ import WorkflowToolEmpty from '@/app/components/tools/add-tool-modal/empty'
|
|||||||
import Card from '@/app/components/plugins/card'
|
import Card from '@/app/components/plugins/card'
|
||||||
import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
|
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 { useSelector as useAppContextSelector } from '@/context/app-context'
|
import { useSelector as useAppContextSelector } from '@/context/app-context'
|
||||||
import { useAllToolProviders } from '@/service/use-tools'
|
import { useAllToolProviders } from '@/service/use-tools'
|
||||||
import { useInstalledPluginList, useInvalidateInstalledPluginList } from '@/service/use-plugins'
|
import { useInstalledPluginList, useInvalidateInstalledPluginList } from '@/service/use-plugins'
|
||||||
@ -31,6 +32,7 @@ const ProviderList = () => {
|
|||||||
{ value: 'builtin', text: t('tools.type.builtIn') },
|
{ value: 'builtin', text: t('tools.type.builtIn') },
|
||||||
{ value: 'api', text: t('tools.type.custom') },
|
{ value: 'api', text: t('tools.type.custom') },
|
||||||
{ value: 'workflow', text: t('tools.type.workflow') },
|
{ value: 'workflow', text: t('tools.type.workflow') },
|
||||||
|
{ value: 'mcp', text: 'MCP' },
|
||||||
]
|
]
|
||||||
const [tagFilterValue, setTagFilterValue] = useState<string[]>([])
|
const [tagFilterValue, setTagFilterValue] = useState<string[]>([])
|
||||||
const handleTagsChange = (value: string[]) => {
|
const handleTagsChange = (value: string[]) => {
|
||||||
@ -82,7 +84,9 @@ const ProviderList = () => {
|
|||||||
options={options}
|
options={options}
|
||||||
/>
|
/>
|
||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<LabelFilter value={tagFilterValue} onChange={handleTagsChange} />
|
{activeTab !== 'mcp' && (
|
||||||
|
<LabelFilter value={tagFilterValue} onChange={handleTagsChange} />
|
||||||
|
)}
|
||||||
<Input
|
<Input
|
||||||
showLeftIcon
|
showLeftIcon
|
||||||
showClearIcon
|
showClearIcon
|
||||||
@ -130,17 +134,18 @@ const ProviderList = () => {
|
|||||||
{!filteredCollectionList.length && activeTab === 'builtin' && (
|
{!filteredCollectionList.length && activeTab === 'builtin' && (
|
||||||
<Empty lightCard text={t('tools.noTools')} className='h-[224px] px-12' />
|
<Empty lightCard text={t('tools.noTools')} className='h-[224px] px-12' />
|
||||||
)}
|
)}
|
||||||
{
|
{enable_marketplace && activeTab === 'builtin' && (
|
||||||
enable_marketplace && activeTab === 'builtin' && (
|
<Marketplace
|
||||||
<Marketplace
|
onMarketplaceScroll={() => {
|
||||||
onMarketplaceScroll={() => {
|
containerRef.current?.scrollTo({ top: containerRef.current.scrollHeight, behavior: 'smooth' })
|
||||||
containerRef.current?.scrollTo({ top: containerRef.current.scrollHeight, behavior: 'smooth' })
|
}}
|
||||||
}}
|
searchPluginText={keywords}
|
||||||
searchPluginText={keywords}
|
filterPluginTags={tagFilterValue}
|
||||||
filterPluginTags={tagFilterValue}
|
/>
|
||||||
/>
|
)}
|
||||||
)
|
{activeTab === 'mcp' && (
|
||||||
}
|
<MCPList searchText={keywords} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{currentProvider && !currentProvider.plugin_id && (
|
{currentProvider && !currentProvider.plugin_id && (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user