8000 Daily0424 by xpy01xpy · Pull Request #13300 · alibaba/nacos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Daily0424 #13300

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 4 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 155 additions & 1 deletion console-ui/src/locales/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,161 @@ const I18N_CONF = {
},
McpServerManagement: {
mcpManagement8: 'MCP Management',
addNewMcpServer: 'Add New Mcp Server',
addNewMcpServer: 'Create MCP Server',
mcpServerName: 'MCP Server Name',
mcpServerGroup: 'MCP Server Group',
search: 'Search',
capability: 'Supported Capabilities',
operation: 'Operations',
delete: 'Delete',
details: 'Details',
sampleConfig: 'Configuration Example',
edit: 'Edit',
mcpServerType: 'Type',
mcpServerVersion: 'Version',
deleteSuccessfully: 'Delete successfully',
deleteMcpServer: 'Are you sure you want to delete the following MCP server?',
description: 'Description',
batchDeleteSuccessfully: 'Batch delete successfully',
batchDeleteFailed: 'Batch delete failed',
},
McpDetail: {
basicInformation: 'Basic Information',
serviceRef: 'Service Reference',
mcpServerDetail: 'MCP Server Details',
operationToolDetail: 'Details',
operationToolEdit: 'Edit',
operationToolDelete: 'Delete',
operationToolDeleteConfirm: 'Are you sure you want to delete the following Operation Tool?',
operationToolDeleteSuccessfully: 'Delete successfully',
operationToolDeleteFailed: 'Delete failed',
toolDetail: 'Tool Details',
toolName: 'Tool Name',
close: 'Close',
toolDescription: 'Tool Description',
toolOnline: 'Enable or Not',
online: 'Enable',
offline: 'Disable',
toolInputSchema: 'Tool Input Parameter Description',
toolParamName: 'Name',
toolParamType: 'Type',
toolParamDescription: 'Description',
namespace: 'Namespace',
serverName: 'Name',
serverType: 'Type',
serverDescription: 'Description',
operations: 'Operations',
backendProtocol: 'Backend Protocol',
exportPath: 'Access Path',
toolMeta: 'Tool Metadata',
invokeContext: 'Invocation Context',
invokeTemplates: 'Invocation Templates',
placeInput: 'Please enter',
createToolSuccess: 'Create Tool successfully',
editToolSuccess: 'Tool edited successfully',
createToolFailed: 'Failed to create Tool',
editToolFailed: 'Failed to edit Tool',
deleteToolTitle: 'Delete Tool',
deleteToolContent: 'Are you sure you want to delete the Tool?',
deleteToolSuccess: 'Tool deleted successfully',
deleteToolFailed: 'Failed to delete Tool',
updateToolSuccess: 'Tool updated successfully',
toolNameRepeat: 'Tool name already exists',
newMcpTool: 'Add',
deleteParam: 'Delete',
toolNameRequired: 'Tool name cannot be empty',
toolDescriptionRequired: 'Tool description cannot be empty',
toolInputSchemaRequired: 'Tool parameter description cannot be empty',
toolParamNameRequired: 'Tool parameter name cannot be empty',
toolParamTypeRequired: 'Tool parameter type cannot be empty',
toolOperation: 'Operation',
toolMetadata: 'Tool metadata',
baseData: 'Basic data',
},
NewMcpServer: {
pleaseComplete: 'Please complete the basic configuration first',
localServerTips1: '[Automatic Installation and Deployment] In conjunction with ',
localServerTips2: ' can be automatically installed to the corresponding environment;',
localServerTips3:
'[Automatic Information Registration] Basic information including tools in the installed MCP server will be automatically registered in Nacos for management;',
localServerTips4:
'[Dynamic Changes Take Effect] Information can be modified dynamically in Nacos during runtime;',
mcpServerDetail: 'MCP Server Details',
operationToolDetail: 'Details',
operationToolEdit: 'Edit',
operationToolDelete: 'Delete',
operationToolDeleteConfirm: 'Are you sure you want to delete the following Operation Tool?',
operationToolDeleteSuccessfully: 'Deleted successfully',
operationToolDeleteFailed: 'Deletion failed',
toolDetail: 'Tool Details',
toolName: 'Tool Name',
close: 'Close',
toolDescription: 'Tool Description',
toolInputSchema: 'Tool Input Parameter Description',
toolParamName: 'Name',
toolParamType: 'Type',
toolParamDescription: 'Description',
serverDescription: 'Description',
operations: 'Operations',
backendProtocol: 'Backend Protocol',
toolMeta: 'Tool Metadata',
invokeContext: 'Invocation Context',
invokeTemplates: 'Invocation Templates',
placeInput: 'Please enter',
createToolSuccess: 'Tool created successfully',
editToolSuccess: 'Tool edited successfully',
createToolFailed: 'Failed to create Tool',
editToolFailed: 'Failed to edit Tool',
deleteToolTitle: 'Delete Tool',
deleteToolContent: 'Are you sure you want to delete the Tool?',
deleteToolSuccess: 'Tool deleted successfully',
deleteToolFailed: 'Failed to delete Tool',
updateToolSuccess: 'Tool updated successfully',
toolNameRepeat: 'Tool name already exists',
newMcpTool: 'Add',
deleteParam: 'Delete',
toolNameRequired: 'Tool name cannot be empty',
toolDescriptionRequired: 'Tool description cannot be empty',
toolOnline: 'Enable or not',
online: 'Enable',
offline: 'Disable',
toolInputSchemaRequired: 'Tool parameter description cannot be empty',
toolParamNameRequired: 'Tool parameter name cannot be empty',
toolParamTypeRequired: 'Tool parameter type cannot be empty',
toolOperation: 'Operation',
toolMetadata: 'Tool metadata',
baseData: 'Basic data',
namespace: 'Namespace',
basicInformation: 'Basic information',
release: 'Back',
escExit: 'Publish',
updateExit: 'Update',
publishSuccessfully: 'Published successfully',
serverName: 'MCP Server Name',
serverNameCannotBeEmpty: 'MCP Server Name cannot be empty',
serviceRef: 'Service Reference',
backendServiceProtocol: 'Backend Service Protocol',
exportPath: 'Access Path',
exportPathDesc: 'The HTTP path exposed by the current MCP server',
description: 'Description',
serverType: 'Protocol Type',
serverVersion: 'Service Version',
pleaseEnter: 'Please enter',
placeSelect: 'Please select',
backendService: 'Backend Service',
serverTypeDesc:
'Supports converting existing HTTP/Dubbo services into MCP services without code modification',
useExistService: 'Use Existing Service',
addNewMcpServer: 'Create MCP Server',
useNewService: 'Create New Service',
editService: 'Edit MCP Server',
viewService: 'View MCP Server',
endpoint: 'Endpoint',
port: 'Port',
localServerConfig: 'Local Server Configuration',
localServerConfigError: 'Local Server Configuration Error',
createSuccessfully: 'Created successfully',
editSuccessfully: 'Edited successfully',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const DeleteTool = props => {
const [visible, setVisible] = React.useState(false);
const [loading, setLoading] = React.useState(false);
const handleDelete = async _toolSpec => {
console.log('_toolSpec', _toolSpec);
props?.onChange && props.onChange(_toolSpec, closeDialog);
// setLoading(true);
// const result = await request({
Expand Down
25 changes: 17 additions & 8 deletions console-ui/src/pages/AI/McpDetail/ShowTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,30 @@ const ShowTools = props => {
>
/>

{console.log('serverConfig?.toolSpec?.tools', serverConfig?.toolSpec)}
<Table style={{ marginTop: '20px' }} dataSource={serverConfig?.toolSpec?.tools || []}>
<Table.Column title={locale.toolName} dataIndex={'name'} />
<Table.Column
title={locale.toolName}
cell={(value, index, record) => {
return <div style={{ minWidth: '100px' }}>{record.name}</div>;
}}
/>
<Table.Column title={locale.toolDescription} dataIndex={'description'} />
<Table.Column
title={locale.toolOnline}
width={100}
cell={(value, index, record) => {
const >
<div style={{ color: 'green', textAlign: 'center' }}>{locale.online}</div>
);
const offlineText = (
<div style={{ color: 'red', textAlign: 'center' }}>{locale.offline}</div>
);
if (serverConfig?.toolSpec?.toolsMeta?.[record.name]) {
return serverConfig?.toolSpec?.toolsMeta?.[record.name]?.enabled ? (
<span style={{ color: 'green' }}>{locale.online}</span>
) : (
<span style={{ color: 'red' }}>{locale.offline}</span>
);
return serverConfig?.toolSpec?.toolsMeta?.[record.name]?.enabled
? onlineText
: offlineText;
} else {
return '--';
return onlineText;
}
}}
/>
Expand Down
10 changes: 4 additions & 6 deletions console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class NewMcpServer extends React.Component {
return new Promise((resolve, reject) => {
this.field.validate((errors, values) => {
if (errors) {
return;
return resolve({ errors });
}
const params = {
mcpName: values?.serverName,
Expand Down Expand Up @@ -332,15 +332,13 @@ class NewMcpServer extends React.Component {
toolsChange = async (_toolSpec = {}, cb = () => {}) => {
const { locale = {} } = this.props;
// 更新 tools 之后, 立即调用接口全量覆盖。
const validate = await this.field.validate();
console.log('validate', validate);
if (!validate) {
const validate = await this.handleData();
if (!validate || validate?.errors) {
// 请先完善基础配置
cb && cb();
return Message.warning(locale.pleaseComplete);
}

console.log('执行下一步执行下一步执行下一步执行下一步执行下一步');
await new Promise(resolve => {
this.setState(
{
Expand Down Expand Up @@ -409,7 +407,7 @@ class NewMcpServer extends React.Component {
const isEdit = getParams('mcptype') && getParams('mcptype') === 'edit';
const formItemLayout = { labelCol: { span: 3 }, wrapperCol: { span: 20 } };
const textAreaProps = { 'aria-label': 'auto height', autoHeight: { minRows: 12, maxRows: 20 } };
const descAreaProps = { 'aria-label': 'auto height', autoHeight: { minRows: 5, maxRows: 20 } };
const descAreaProps = { 'aria-label': 'auto height', autoHeight: { minRows: 5, maxRows: 10 } };

return (
<Loading
Expand Down
0