From 46d44e3405cb3973b2dadb67aac0a84ef74dda00 Mon Sep 17 00:00:00 2001 From: anka <1350989414@qq.com> Date: Wed, 30 Apr 2025 23:52:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A7=A9=E5=9C=A8=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0mcp=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/dashboard/routes/plugin.py | 4 +++- dashboard/src/views/ToolUsePage.vue | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/astrbot/dashboard/routes/plugin.py b/astrbot/dashboard/routes/plugin.py index 9fb9d231a..9f76e2a71 100644 --- a/astrbot/dashboard/routes/plugin.py +++ b/astrbot/dashboard/routes/plugin.py @@ -145,7 +145,9 @@ class PluginRoute(Route): if handler.event_type == EventType.AdapterMessageEvent: # 处理平台适配器消息事件 has_admin = False - for filter in ( + for ( + filter + ) in ( handler.event_filters ): # 正常handler就只有 1~2 个 filter,因此这里时间复杂度不会太高 if isinstance(filter, CommandFilter): diff --git a/dashboard/src/views/ToolUsePage.vue b/dashboard/src/views/ToolUsePage.vue index fe546a2b9..312fca87b 100644 --- a/dashboard/src/views/ToolUsePage.vue +++ b/dashboard/src/views/ToolUsePage.vue @@ -560,7 +560,16 @@ export default { // 过滤后的市场服务器 filteredMarketplaceServers() { - return this.marketplaceServers; + if (!this.marketplaceSearch.trim()) { + return this.marketplaceServers; + } + + const searchTerm = this.marketplaceSearch.toLowerCase(); + return this.marketplaceServers.filter(server => + server.name.toLowerCase().includes(searchTerm) || + (server.name_h && server.name_h.toLowerCase().includes(searchTerm)) || + (server.description && server.description.toLowerCase().includes(searchTerm)) + ); }, },