-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: Add create MCP function #3885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <template> | ||
| <el-avatar v-if="type == 'MCP'" shape="square" :size="size"> | ||
| <img src="@/assets/workflow/icon_mcp.svg" style="width: 75%" alt="" /> | ||
| </el-avatar> | ||
| <el-avatar v-else class="avatar-green" shape="square" :size="size"> | ||
| <img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" /> | ||
| </el-avatar> | ||
| </template> | ||
| <script setup lang="ts"> | ||
| defineOptions({ name: 'ToolIcon' }) | ||
| const props = defineProps({ | ||
| type: { | ||
| type: [String, Number], | ||
| default: '', | ||
| }, | ||
| size: { | ||
| type: [String, Number], | ||
| default: 32, | ||
| }, | ||
| }) | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,3 +282,8 @@ | |
| .el-tag { | ||
| padding: 0 6px; | ||
| } | ||
|
|
||
| // el-input | ||
| .el-input { | ||
| --el-input-text-color: var(--el-text-color-primary); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code is mostly clean but has a few areas that could be improved:
Template Tags: There are some unnecessary HTML comments and tags like
<template #label>without corresponding content. These should either contain text or conditional rendering logic.Error Handling: The
@submit.preventdoes not do anything meaningful because there's no form submission in this component. It would work with Vue forms, so ensure you have a valid form set up for handling submissions.Language Translation References (
$t) Usage: Ensure all$treferences point to existing keys in your translation files. If they don't exist, replace them with suitable placeholders like'common.someKey'.Conditional Rendering Logic: In the
v-ifblock formcp_tool_id, you've added required validation rules directly within the template using inline script. This can make it difficult to manage and test changes later. Consider moving these rules into an array of objects or outside the template where it's easier to read and maintain.Here’s a slightly adjusted version with a focus on improving readability and ensuring proper usage ofVue features:
Additional Corrections:
This way, rules remain decoupled from the UI elements. Also, handle errors gracefully during validation.
For tooltips, include a proper tooltip provider such as Element Plus’s
ElTooltip.By implementing these corrections and enhancements, the code will become more robust, user-friendly, and maintainable while keeping its functionality intact.