feat: CCW Dashboard 增强 - 停止命令、浏览器修复和MCP多源配置

- 新增 ccw stop 命令支持优雅停止和强制终止 (--force)
- 修复 ccw view 服务器检测时浏览器无法打开的问题
- MCP 配置现在从多个源读取:
  - ~/.claude.json (项目级)
  - ~/.claude/settings.json 和 settings.local.json (全局)
  - 各工作空间的 .claude/settings.json (工作空间级)
- 新增全局 MCP 服务器显示区域
- 修复路径选择模态框样式问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-08 10:28:07 +08:00
parent f4299457fb
commit 27273405f7
8 changed files with 377 additions and 21 deletions

View File

@@ -4,6 +4,7 @@
// ========== MCP State ==========
let mcpConfig = null;
let mcpAllProjects = {};
let mcpGlobalServers = {};
let mcpCurrentProjectServers = {};
let mcpCreateMode = 'form'; // 'form' or 'json'
@@ -31,6 +32,7 @@ async function loadMcpConfig() {
const data = await response.json();
mcpConfig = data;
mcpAllProjects = data.projects || {};
mcpGlobalServers = data.globalServers || {};
// Get current project servers
const currentPath = projectPath.replace(/\//g, '\\');
@@ -150,6 +152,15 @@ function updateMcpBadge() {
function getAllAvailableMcpServers() {
const allServers = {};
// Collect global servers first
for (const [name, serverConfig] of Object.entries(mcpGlobalServers)) {
allServers[name] = {
config: serverConfig,
usedIn: [],
isGlobal: true
};
}
// Collect servers from all projects
for (const [path, config] of Object.entries(mcpAllProjects)) {
const servers = config.mcpServers || {};
@@ -157,7 +168,8 @@ function getAllAvailableMcpServers() {
if (!allServers[name]) {
allServers[name] = {
config: serverConfig,
usedIn: []
usedIn: [],
isGlobal: false
};
}
allServers[name].usedIn.push(path);