mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
feat(ccw): 智能识别运行中的服务器,支持工作空间切换
- ccw view 自动检测服务器是否已运行 - 已运行时切换工作空间并打开浏览器,无需重启服务器 - 新增 /api/switch-path 和 /api/health 端点 - Dashboard 支持 URL path 参数加载指定工作空间 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,17 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
// Server mode: load data from API
|
||||
try {
|
||||
if (window.SERVER_MODE) {
|
||||
await switchToPath(window.INITIAL_PATH || projectPath);
|
||||
// Check URL for path parameter (from ccw view command)
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const urlPath = urlParams.get('path');
|
||||
const initialPath = urlPath || window.INITIAL_PATH || projectPath;
|
||||
|
||||
await switchToPath(initialPath);
|
||||
|
||||
// Clean up URL after loading (remove query param)
|
||||
if (urlPath && window.history.replaceState) {
|
||||
window.history.replaceState({}, '', window.location.pathname);
|
||||
}
|
||||
} else {
|
||||
renderDashboard();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user