From bde80bc3b764cd4fe5f266c450d7fdaa4e37e999 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Tue, 15 Jul 2025 22:05:43 +0800 Subject: [PATCH] finish 0.1.10 --- CHANGELOG.md | 1 + src/sidebar/installed.service.ts | 6 ++++++ src/sidebar/workspace.service.ts | 10 +++++++--- src/webview/webview.service.ts | 14 ++++++++------ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb661ca..76305ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - 实现 issue#49,工具模块,调试希望支持markdown渲染回显。 https://picx.zhimg.com/80/v2-5d708ccab00f33fdf63a656a0066bf23_1440w.png - 实现 issue#54,右击服务器列表名,可以重命名服务器。 https://picx.zhimg.com/80/v2-87c2a29abdd2dd56a4d18cc4a8b946ff_1440w.png - 修复 resources 和 prompts 有关热更新的一些问题。 +- 更新 vscode 创建的标签栏的标题。 https://picx.zhimg.com/80/v2-4d40c20f3eaa032573e4de58298c859f_1440w.png ## [main] 0.1.9 - 增加 mook 功能:可以利用随机种子或者AI生成来自动化填充测试 tool 的表单数据 diff --git a/src/sidebar/installed.service.ts b/src/sidebar/installed.service.ts index 5c1fa9a..19af057 100644 --- a/src/sidebar/installed.service.ts +++ b/src/sidebar/installed.service.ts @@ -69,6 +69,12 @@ export async function changeInstalledConnectionName(item: McpOptions[] | McpOpti // 获取已安装的连接配置 const installedConnection = getConnectionConfig(); + // 更新 panel 标题 + if (masterNode.name && panels.has(masterNode.name)) { + const panel = panels.get(masterNode.name)!; + panel.title = 'OpenMCP ' + newName.trim(); + } + // 更新连接名称 masterNode.name = newName.trim(); masterNode.rename = true; diff --git a/src/sidebar/workspace.service.ts b/src/sidebar/workspace.service.ts index e4cacf5..c3cce4e 100644 --- a/src/sidebar/workspace.service.ts +++ b/src/sidebar/workspace.service.ts @@ -76,12 +76,16 @@ export async function changeUserConnectionName(item: McpOptions[] | McpOptions) return; } + // 更新 panel 标题 + if (masterNode.name && panels.has(masterNode.name)) { + const panel = panels.get(masterNode.name)!; + panel.title = 'OpenMCP ' + newName.trim(); + } + // 更新连接名称 masterNode.name = newName.trim(); masterNode.rename = true; - - vscode.window.showInformationMessage('enter here'); - + // 保存更新后的配置 const workspacePath = getWorkspacePath(); saveWorkspaceConnectionConfig(workspacePath); diff --git a/src/webview/webview.service.ts b/src/webview/webview.service.ts index df24c1f..42b9578 100644 --- a/src/webview/webview.service.ts +++ b/src/webview/webview.service.ts @@ -1,7 +1,7 @@ import * as vscode from 'vscode'; import * as fs from 'fs'; import * as fspath from 'path'; -import { ConnectionType, exportFile, McpOptions, panels, updateInstalledConnectionConfig, updateWorkspaceConnectionConfig } from '../global.js'; +import { ConnectionType, detachMcpOptionAsItem, exportFile, McpOptions, panels, updateInstalledConnectionConfig, updateWorkspaceConnectionConfig } from '../global.js'; import { routeMessage } from '../../openmcp-sdk/service/index.js'; export function getWebviewContent(context: vscode.ExtensionContext, panel: vscode.WebviewPanel): string | undefined { @@ -49,11 +49,14 @@ export function revealOpenMcpWebviewPanel( if (itemType === 'STDIO') { item.commandString = [item.command, ...(item.args || [])]?.join(' '); } - }) + }); + + const item = detachMcpOptionAsItem(option); + const panelTitle = 'OpenMCP ' + item.name; const panel = vscode.window.createWebviewPanel( - 'OpenMCP', - 'OpenMCP', + 'openmcp-webview', + panelTitle, vscode.ViewColumn.One, { enableScripts: true, @@ -64,7 +67,6 @@ export function revealOpenMcpWebviewPanel( panels.set(panelKey, panel); - // 设置HTML内容 const html = getWebviewContent(context, panel); panel.webview.html = html || ''; @@ -163,7 +165,7 @@ export function revealOpenMcpNewsWebviewPanel( ) { const panel = vscode.window.createWebviewPanel( - 'What\'s new in OpenMCP', + 'openmcp-whatnews', 'What\'s new in OpenMCP', vscode.ViewColumn.One, {