-
Notifications
You must be signed in to change notification settings - Fork 2.8k
refactor: change mcp workflow node name #2750
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,8 +221,8 @@ export default { | |
| assign: '赋值' | ||
| }, | ||
| mcpNode: { | ||
| label: 'MCP 节点', | ||
| text: '调用 MCP 工具', | ||
| label: 'MCP 调用', | ||
| text: '通过 SSE 方式执行 MCP 服务中的工具', | ||
| getToolsSuccess: '获取工具成功', | ||
| getTool: '获取工具', | ||
| tool: '工具', | ||
liuruibin marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code looks clean overall but can be enhanced for clarity and maintainability. Here are some suggestions:
Here's with these improvements applied: export default {
assignment: '赋值',
mcpNode: {
// Use a single key for label and text to improve consistency
label: 'MCP调用',
text: '通过 SSE方式执行 MCP服务中的工具',
getToolsSuccess: '获取工具成功',
getTool: '获取工具',
tool: '工具',
},
};Key Changes:
These changes make the code more readable and maintainable while preserving the intended functionality. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,8 +221,8 @@ export default { | |
| assign: '賦值' | ||
| }, | ||
| mcpNode: { | ||
| label: 'MCP 節點', | ||
| text: '呼叫 MCP 工具', | ||
| label: 'MCP 調用', | ||
| text: '透過SSE方式執行MCP服務中的工具', | ||
| getToolsSuccess: '獲取工具成功', | ||
| getTool: '獲取工具', | ||
| tool: '工具', | ||
liuruibin marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code has a small error in the export default {
assign: '賦值',
},
mcpNode: {
label: 'MCP 調用',
text: '透過 SSE 方式執行 MCP 服務中的工具', // Corrected here
getToolsSuccess: '獲取工具成功',
getTool: '獲取工具',
tool: '工具'
}This change ensures clarity and accuracy in describing the functionality described as "through SSE method to execute tools within the MCP service." |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -324,11 +324,21 @@ const validate = async () => { | |
|
|
||
| if (requiredFields.length > 0) { | ||
| for (const item of requiredFields) { | ||
| if (!form_data.value.tool_params[form_data.value.params_nested][item]) { | ||
| return Promise.reject({ | ||
| node: props.nodeModel, | ||
| errMessage: item + t('dynamicsForm.tip.requiredMessage') | ||
| }) | ||
| if (form_data.value.params_nested) { | ||
| if (!form_data.value.tool_params[form_data.value.params_nested][item]) { | ||
| return Promise.reject({ | ||
| node: props.nodeModel, | ||
| errMessage: item + t('dynamicsForm.tip.requiredMessage') | ||
| }) | ||
| } | ||
| } else { | ||
| // 这里是没有嵌套的情况 | ||
| if (!form_data.value.tool_params[item]) { | ||
| return Promise.reject({ | ||
| node: props.nodeModel, | ||
| errMessage: item + t('dynamicsForm.tip.requiredMessage') | ||
| }) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your code is generally clean, but there are a few areas that could be improved:
Here’s the refactored version with these improvements: const validate = async () => {
if (requiredFields.length > 0) {
for (const item of requiredFields) {
// Check if form_data.value.tools_params exists and contains the specified item
if (form_data && form_data.tool_params && form_data.tool_params.form_data_nested && !form_data.tool_params.form_data_nested[item]) {
return Promise.reject({
node: props.nodeModel,
errMessage: item + t('dynamicsForm.tip.requiredMessage')
});
}
// For non-nested params
if (form_data && form_data.tool_params && !form_data.tool_params[item]) {
return Promise.reject({
node: props.nodeModel,
errMessage: item + t('dynamicsForm.tip.requiredMessage')
});
}
}
}
};This code includes checks for both nested and non-nested cases, ensuring that the application handles scenarios where either structure might be missing. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.