diff --git a/web/app/components/tools/plugin-category-page.tsx b/web/app/components/tools/plugin-category-page.tsx
index 2323ce8ad0..c7a9b39397 100644
--- a/web/app/components/tools/plugin-category-page.tsx
+++ b/web/app/components/tools/plugin-category-page.tsx
@@ -21,7 +21,7 @@ const PluginCategoryPage = ({
return (
)
diff --git a/web/app/components/tools/provider-list.tsx b/web/app/components/tools/provider-list.tsx
index e4210f94b2..0cb37dae08 100644
--- a/web/app/components/tools/provider-list.tsx
+++ b/web/app/components/tools/provider-list.tsx
@@ -1,5 +1,7 @@
'use client'
+import type { ToolsContentInset } from './content-inset'
import type { Collection } from './types'
+import type { Plugin } from '@/app/components/plugins/types'
import type { ToolCategory } from '@/app/components/tools/integration-routes'
import { cn } from '@langgenius/dify-ui/cn'
import { useSuspenseQuery } from '@tanstack/react-query'
@@ -13,15 +15,15 @@ import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
import { useTags } from '@/app/components/plugins/hooks'
import Empty from '@/app/components/plugins/marketplace/empty'
import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
-import { buildIntegrationPath, sectionByToolCategory, TOOL_CATEGORY_VALUES } from '@/app/components/tools/integration-routes'
+import { TOOL_CATEGORY_VALUES } from '@/app/components/tools/integration-routes'
import LabelFilter from '@/app/components/tools/labels/filter'
import CustomCreateCard from '@/app/components/tools/provider/custom-create-card'
import ProviderDetail from '@/app/components/tools/provider/detail'
import WorkflowToolEmpty from '@/app/components/tools/provider/empty'
-import { useRouter } from '@/next/navigation'
import { systemFeaturesQueryOptions } from '@/service/system-features'
import { useCheckInstalled, useInvalidateInstalledPluginList } from '@/service/use-plugins'
import { useAllToolProviders } from '@/service/use-tools'
+import { toolsContentInsetClassNames } from './content-inset'
import Marketplace from './marketplace'
import { useMarketplace } from './marketplace/hooks'
import MCPList from './mcp'
@@ -38,15 +40,16 @@ const parseAsToolProviderCategory = parseAsStringLiteral(TOOL_CATEGORY_VALUES)
type ProviderListProps = {
category?: ToolCategory
+ contentInset?: ToolsContentInset
}
const ProviderList = ({
category,
+ contentInset = 'default',
}: ProviderListProps) => {
// const searchParams = useSearchParams()
// searchParams.get('category') === 'workflow'
const { t } = useTranslation()
- const router = useRouter()
const { getTagLabel } = useTags()
const { data: enable_marketplace } = useSuspenseQuery({
...systemFeaturesQueryOptions(),
@@ -56,6 +59,8 @@ const ProviderList = ({
const [categoryParam, setCategoryParam] = useQueryState('category', parseAsToolProviderCategory)
const activeTab = category ?? categoryParam
+ const isRouteCategory = !!category
+ const contentPaddingClassName = toolsContentInsetClassNames[contentInset]
const options = [
{ value: 'builtin', text: t('type.builtIn', { ns: 'tools' }) },
{ value: 'api', text: t('type.custom', { ns: 'tools' }) },
@@ -138,26 +143,27 @@ const ProviderList = ({
ref={containerRef}
className="relative flex grow flex-col overflow-y-auto bg-background-body"
>
-
-
{
- if (!isToolProviderCategory(state))
- return
- if (category)
- router.push(buildIntegrationPath(sectionByToolCategory[state]))
- else
+ {!isRouteCategory && (
+ {
+ if (!isToolProviderCategory(state))
+ return
setCategoryParam(state)
- if (state !== activeTab)
- setCurrentProviderId(undefined)
- }}
- options={options}
- />
+ if (state !== activeTab)
+ setCurrentProviderId(undefined)
+ }}
+ options={options}
+ />
+ )}
{activeTab !== 'mcp' && (
@@ -173,10 +179,12 @@ const ProviderList = ({
{activeTab !== 'mcp' && (
-
{activeTab === 'api' && }
{filteredCollectionList.map(collection => (
@@ -195,7 +203,7 @@ const ProviderList = ({
brief: collection.description,
org: collection.plugin_id ? collection.plugin_id.split('/')[0] : '',
name: collection.plugin_id ? collection.plugin_id.split('/')[1] : collection.name,
- } as any}
+ } as unknown as Plugin}
footer={(
getTagLabel(label)) || []}
@@ -208,7 +216,7 @@ const ProviderList = ({
)}
{!filteredCollectionList.length && activeTab === 'builtin' && (
-
+
)}
{enable_marketplace && activeTab === 'builtin' && (
@@ -218,10 +226,11 @@ const ProviderList = ({
isMarketplaceArrowVisible={isMarketplaceArrowVisible}
showMarketplacePanel={showMarketplacePanel}
marketplaceContext={marketplaceContext}
+ contentInset={contentInset}
/>
)}
{activeTab === 'mcp' && (
-
+
)}