AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

fix: mcp 服务器页面搜索功能无法使用: 在前端实现搜索

Open anka-afk opened this issue 1 year ago • 1 comments

解决了 #1446

Motivation

mcp服务器页面搜索功能无法使用

Modifications

在前端过滤搜索内容

Check

  • [x] 😊 我的 Commit Message 符合良好的规范
  • [x] 👀 我的更改经过良好的测试
  • [x] 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txt 和 pyproject.toml 文件相应位置。
  • [x] 😮 我的更改没有引入恶意代码

好的,这是翻译成中文的 pull request 总结:

Sourcery 总结

在 MCP 服务页面中实现 marketplace 服务器的搜索功能

新特性:

  • 为 marketplace 服务器添加了客户端搜索过滤功能

Bug 修复:

  • 修复了 MCP 服务器页面上搜索功能无法正常工作的问题

增强功能:

  • 实现了跨服务器名称、别名和描述的搜索
Original summary in English

Summary by Sourcery

Implement search functionality for marketplace servers in the MCP service page

New Features:

  • Added client-side search filtering for marketplace servers

Bug Fixes:

  • Fixed search functionality not working on the MCP server page

Enhancements:

  • Implemented search across server name, alternative name, and description

anka-afk avatar Apr 30 '25 15:04 anka-afk

## 审核者指南

此拉取请求通过在前端实现过滤逻辑来修复 MCP 页面上的服务器搜索功能。`ToolUsePage.vue` 中的 `filteredMarketplaceServers` 计算属性现在根据用户的搜索输入来过滤显示的服务器列表。

### 文件级别更改

| 变更 | 详情 | 文件 |
| ------ | ------- | ----- |
| 实现了 marketplace 服务器的客户端搜索过滤。 | <ul><li>修改了 `filteredMarketplaceServers` 计算属性,以根据 `marketplaceSearch` 输入过滤服务器列表。</li><li>添加了针对服务器 `name`、`name_h` 和 `description` 字段的不区分大小写的匹配。</li><li>如果搜索输入为空,则返回未过滤的列表。</li></ul> | `dashboard/src/views/ToolUsePage.vue` |

### 可能相关的 issue

- **#1446**: PR 通过添加基于名称和描述的前端过滤来修复 mcp 服务器页面搜索错误。
- **#1446**: PR 实现了前端搜索以修复 mcp 服务器页面搜索功能问题 #1446。

---

<details>
<summary>提示和命令</summary>

#### 与 Sourcery 互动

- **触发新的审查:** 在拉取请求上评论 `@sourcery-ai review`。
- **继续讨论:** 直接回复 Sourcery 的审查评论。
- **从审查评论生成 GitHub issue:** 通过回复审查评论,要求 Sourcery 从审查评论创建一个 issue。您也可以回复审查评论并使用 `@sourcery-ai issue` 从中创建一个 issue。
- **生成拉取请求标题:** 在拉取请求标题中的任何位置写入 `@sourcery-ai` 以随时生成标题。您也可以在拉取请求上评论 `@sourcery-ai title` 以随时(重新)生成标题。
- **生成拉取请求摘要:** 在拉取请求正文中的任何位置写入 `@sourcery-ai summary` 以随时在您想要的位置生成 PR 摘要。您也可以在拉取请求上评论 `@sourcery-ai summary` 以随时(重新)生成摘要。
- **生成审核者指南:** 在拉取请求上评论 `@sourcery-ai guide` 以随时(重新)生成审核者指南。
- **解决所有 Sourcery 评论:** 在拉取请求上评论 `@sourcery-ai resolve` 以解决所有 Sourcery 评论。如果您已经解决了所有评论并且不想再看到它们,这将非常有用。
- **驳回所有 Sourcery 审查:** 在拉取请求上评论 `@sourcery-ai dismiss` 以驳回所有现有的 Sourcery 审查。如果您想重新开始新的审查,这将特别有用 - 不要忘记评论 `@sourcery-ai review` 以触发新的审查!

#### 自定义您的体验

访问您的 [仪表板](https://app.sourcery.ai) 以:
- 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审核者指南等。
- 更改审查语言。
- 添加、删除或编辑自定义审查说明。
- 调整其他审查设置。

#### 获取帮助

- [联系我们的支持团队](mailto:[email protected]) 提出问题或反馈。
- 访问我们的 [文档](https://docs.sourcery.ai) 以获取详细的指南和信息。
- 通过在 [X/Twitter](https://x.com/SourceryAI)、[LinkedIn](https://www.linkedin.com/company/sourcery-ai/) 或 [GitHub](https://github.com/sourcery-ai) 上关注我们,与 Sourcery 团队保持联系。

</details>
Original review guide in English

Reviewer's Guide

This pull request fixes the server search functionality on the MCP page by implementing filtering logic on the frontend. The filteredMarketplaceServers computed property in ToolUsePage.vue now filters the displayed server list based on the user's search input.

File-Level Changes

Change Details Files
Implemented client-side search filtering for marketplace servers.
  • Modified the filteredMarketplaceServers computed property to filter the server list based on the marketplaceSearch input.
  • Added case-insensitive matching against the server name, name_h, and description fields.
  • Returns the unfiltered list if the search input is empty.
dashboard/src/views/ToolUsePage.vue

Possibly linked issues

  • #1446: PR fixes the mcp server page search bug by adding frontend filtering based on name and description.
  • #1446: The PR implements frontend search to fix the mcp server page search function issue #1446.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Apr 30 '25 15:04 sourcery-ai[bot]