mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
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:
@@ -3,13 +3,24 @@ import { platform } from 'os';
|
||||
import { resolve } from 'path';
|
||||
|
||||
/**
|
||||
* Launch a file in the default browser
|
||||
* Launch a URL or file in the default browser
|
||||
* Cross-platform compatible (Windows/macOS/Linux)
|
||||
* @param {string} filePath - Path to HTML file
|
||||
* @param {string} urlOrPath - HTTP URL or path to HTML file
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
export async function launchBrowser(filePath) {
|
||||
const absolutePath = resolve(filePath);
|
||||
export async function launchBrowser(urlOrPath) {
|
||||
// Check if it's already a URL (http:// or https://)
|
||||
if (urlOrPath.startsWith('http://') || urlOrPath.startsWith('https://')) {
|
||||
try {
|
||||
await open(urlOrPath);
|
||||
return;
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to open browser: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
// It's a file path - convert to file:// URL
|
||||
const absolutePath = resolve(urlOrPath);
|
||||
|
||||
// Construct file:// URL based on platform
|
||||
let url;
|
||||
|
||||
Reference in New Issue
Block a user