diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 7263ce45ac862e471408ebb62d8c8cb05f7a6998..5ad57468b60c6128fa4d644ab29192798952410c 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -10,6 +10,7 @@ export default { null: 'No Data', createTime: 'Create Time', operate: 'Operate', + copy: 'Copy', }, settings: { model: 'Model', diff --git a/src/i18n/lang/zh-cn.ts b/src/i18n/lang/zh-cn.ts index 8243536d12a19fd4eef5ea3a3d973ba1dee35ac0..7222b87347cfedc8d29aa134a6052c70c2de39a7 100644 --- a/src/i18n/lang/zh-cn.ts +++ b/src/i18n/lang/zh-cn.ts @@ -10,6 +10,7 @@ export default { null: '暂无数据', createTime: '创建时间', operate: '操作', + copy: '复制', }, settings: { model: '模型', diff --git a/src/views/api/components/McpServiceDetail.vue b/src/views/api/components/McpServiceDetail.vue index 94f35bdd86a4620e1853d89f66c5b2d7dbb2f215..5f8abef6bea3446b0e4fb0e17bf069e25c91ed10 100644 --- a/src/views/api/components/McpServiceDetail.vue +++ b/src/views/api/components/McpServiceDetail.vue @@ -50,19 +50,12 @@ const activeTab = ref<'description' | 'tools'>('description'); const mcpServiceDetail = ref(); -const activeNames = ref([]); +const activeNames = ref([]); async function getMcpServiceDetail(serviceId: string) { const [_, res] = await api.getMcpServiceDetail(serviceId); if (res) { mcpServiceDetail.value = res.result; - // mcpServiceDetail.value.tools.forEach((tool) => { - // tool.input_schema.properties = [] - // for (const key in tool.input_schema.properties) { - // tooo - // } - // }) - // console.log(mcpServiceDetail.value); } } @@ -72,6 +65,9 @@ watch( if (props.visible) { if (!props.serviceId) return; getMcpServiceDetail(props.serviceId); + } else { + mcpServiceDetail.value = undefined; + activeTab.value = 'description'; } }, ); @@ -81,6 +77,7 @@ watch( @@ -111,12 +108,19 @@ watch( {{ tool.description }} - +
@@ -179,12 +195,12 @@ :title="actionName" :show-close="false" header-class="drawerHeader" - destory-on-close="true" + destroy-on-close :direction="direction" :before-close="handleClose" >
-
+
{ }; const handleSearchApiList = (type: 'my' | 'createdByMe' | 'favorited') => { - console.log(type,'type'); if (type === 'my') { apiType.value = 'my'; queryList(pluginType.value); @@ -452,6 +471,11 @@ const handleSearchApiList = (type: 'my' | 'createdByMe' | 'favorited') => { } }; +function onCopyServiceId(id: string) { + writeText(id); + successMsg(t('feedback.copied_successfully')); +} + const handleDelApi = (id: string) => { if (pluginType.value === 'semantic_interface') { ElMessageBox.confirm('确定删除此接口吗?', '提示', { diff --git a/src/views/api/style.scss b/src/views/api/style.scss index fb4c0923df85b87e62a95d14c90cb5ed7f2aa055..2b0e5384e604786eb1460155a2861ef85492fb30 100644 --- a/src/views/api/style.scss +++ b/src/views/api/style.scss @@ -78,7 +78,6 @@ justify-content: space-between; border-radius: 8px; width: 320px; - height: 136px; padding: 16px; background-color: var(--o-bg-color-base); .apiCenterCardContentCollect { @@ -105,17 +104,33 @@ .apiCenterCardBottom { margin-top: 16px; display: flex; - justify-content: space-between; - .apiCenterCardUser { + flex-direction: column; + + .apiCenterCardId { font-size: 12px; line-height: 16px; + display: flex ; + align-items: center; + justify-content: space-between; } - .apiCenterCardOps { - .el-button span { - color: #6395fd; + .apiCenterCardFooter { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 4px; + + .apiCenterCardUser { font-size: 12px; + line-height: 16px; + } + .apiCenterCardOps { + .el-button span { + color: #6395fd; + font-size: 12px; + } } } + } } .apiCenterCardSingle:hover {