mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 13:26:06 +08:00
chore: in tool picker can not choose mcp
This commit is contained in:
parent
8d2238d631
commit
d1983e4d06
@ -35,6 +35,7 @@ type AllToolsProps = {
|
||||
canNotSelectMultiple?: boolean
|
||||
onSelectMultiple?: (type: BlockEnum, tools: ToolDefaultValue[]) => void
|
||||
selectedTools?: ToolValue[]
|
||||
isHideMCPTools?: boolean
|
||||
}
|
||||
|
||||
const DEFAULT_TAGS: AllToolsProps['tags'] = []
|
||||
@ -52,9 +53,10 @@ const AllTools = ({
|
||||
customTools,
|
||||
mcpTools = [],
|
||||
selectedTools,
|
||||
isHideMCPTools,
|
||||
}: AllToolsProps) => {
|
||||
const language = useGetLanguage()
|
||||
const tabs = useToolTabs()
|
||||
const tabs = useToolTabs(isHideMCPTools)
|
||||
const [activeTab, setActiveTab] = useState(ToolTypeEnum.All)
|
||||
const [activeView, setActiveView] = useState<ViewType>(ViewType.flat)
|
||||
const hasFilter = searchText || tags.length > 0
|
||||
|
@ -31,10 +31,9 @@ export const useTabs = () => {
|
||||
]
|
||||
}
|
||||
|
||||
export const useToolTabs = () => {
|
||||
export const useToolTabs = (isHideMCPTools?: boolean) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return [
|
||||
const tabs = [
|
||||
{
|
||||
key: ToolTypeEnum.All,
|
||||
name: t('workflow.tabs.allTool'),
|
||||
@ -51,9 +50,13 @@ export const useToolTabs = () => {
|
||||
key: ToolTypeEnum.Workflow,
|
||||
name: t('workflow.tabs.workflowTool'),
|
||||
},
|
||||
{
|
||||
]
|
||||
if(!isHideMCPTools) {
|
||||
tabs.push({
|
||||
key: ToolTypeEnum.MCP,
|
||||
name: 'MCP',
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
return tabs
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ const Tabs: FC<TabsProps> = ({
|
||||
customTools={customTools || []}
|
||||
workflowTools={workflowTools || []}
|
||||
mcpTools={mcpTools || []}
|
||||
isHideMCPTools
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user