From 78a952ff3c2fd28a3cc5241558263f21c5bc5f5d Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 23 Jul 2025 10:41:13 +0800 Subject: [PATCH] fix: can not choose not from marketplace package --- .../auto-update-setting/tool-picker.tsx | 94 ++++++++++--------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx b/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx index fcd8f64519..02c1ecaf35 100644 --- a/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx +++ b/web/app/components/plugins/reference-setting-modal/auto-update-setting/tool-picker.tsx @@ -14,6 +14,7 @@ import cn from '@/utils/classnames' import ToolItem from './tool-item' import Loading from '@/app/components/base/loading' import NoDataPlaceholder from './no-data-placeholder' +import { PluginSource } from '../../types' type Props = { trigger: React.ReactNode @@ -70,8 +71,9 @@ const ToolPicker: FC = ({ const filteredList = useMemo(() => { const list = data ? data.plugins : [] return list.filter((plugin) => { + const isFromMarketPlace = plugin.source === PluginSource.marketplace return ( - (pluginType === PLUGIN_TYPE_SEARCH_MAP.all || plugin.declaration.category === pluginType) + isFromMarketPlace && (pluginType === PLUGIN_TYPE_SEARCH_MAP.all || plugin.declaration.category === pluginType) && (tags.length === 0 || tags.some(tag => plugin.declaration.tags.includes(tag))) && (query === '' || plugin.plugin_id.toLowerCase().includes(query.toLowerCase())) ) @@ -111,54 +113,54 @@ const ToolPicker: FC = ({ return ( + - - {trigger} - - -
-
- -
-
-
- { - tabs.map(tab => ( -
setPluginType(tab.key)} - > - {tab.name} -
- )) - } -
+ {trigger} + + +
+
+ +
+
+
+ { + tabs.map(tab => ( +
setPluginType(tab.key)} + > + {tab.name} +
+ )) + }
- {!isLoading && filteredList.length > 0 && listContent} - {!isLoading && filteredList.length === 0 && noData} - {isLoading && loadingContent}
- - + {!isLoading && filteredList.length > 0 && listContent} + {!isLoading && filteredList.length === 0 && noData} + {isLoading && loadingContent} +
+
+ ) }