Files
Claude-Code-Workflow/ccw/src/templates/dashboard-js/main.js
catlog22 43c962b48b feat: Add Notifications Component with WebSocket and Auto Refresh
- Implemented a Notifications component for real-time updates using WebSocket.
- Added silent refresh functionality to update data without notification bubbles.
- Introduced auto-refresh mechanism to periodically check for changes in workflow data.
- Enhanced data handling with session and task updates, ensuring UI reflects the latest state.

feat: Create Hook Manager View for Managing Hooks

- Developed a Hook Manager view to manage project and global hooks.
- Added functionality to create, edit, and delete hooks with a user-friendly interface.
- Implemented quick install templates for common hooks to streamline user experience.
- Included environment variables reference for hooks to assist users in configuration.

feat: Implement MCP Manager View for Server Management

- Created an MCP Manager view for managing MCP servers within projects.
- Enabled adding and removing servers from projects with a clear UI.
- Displayed available servers from other projects for easy access and management.
- Provided an overview of all projects and their associated MCP servers.

feat: Add Version Fetcher Utility for GitHub Releases

- Implemented a version fetcher utility to retrieve release information from GitHub.
- Added functions to fetch the latest release, recent releases, and latest commit details.
- Included functionality to download and extract repository zip files.
- Ensured cleanup of temporary directories after downloads to maintain system hygiene.
2025-12-07 15:48:39 +08:00

58 lines
2.2 KiB
JavaScript

// Application Entry Point
// Initializes all components and sets up global event handlers
document.addEventListener('DOMContentLoaded', async () => {
// Initialize components with error handling to prevent cascading failures
try { initTheme(); } catch (e) { console.error('Theme init failed:', e); }
try { initSidebar(); } catch (e) { console.error('Sidebar init failed:', e); }
try { initPathSelector(); } catch (e) { console.error('Path selector init failed:', e); }
try { initNavigation(); } catch (e) { console.error('Navigation init failed:', e); }
try { initSearch(); } catch (e) { console.error('Search init failed:', e); }
try { initRefreshButton(); } catch (e) { console.error('Refresh button init failed:', e); }
try { initCarousel(); } catch (e) { console.error('Carousel init failed:', e); }
try { initMcpManager(); } catch (e) { console.error('MCP Manager init failed:', e); }
try { initHookManager(); } catch (e) { console.error('Hook Manager init failed:', e); }
// Initialize real-time features (WebSocket + auto-refresh)
try { initWebSocket(); } catch (e) { console.log('WebSocket not available:', e.message); }
try { initAutoRefresh(); } catch (e) { console.error('Auto-refresh init failed:', e); }
// Server mode: load data from API
try {
if (window.SERVER_MODE) {
await switchToPath(window.INITIAL_PATH || projectPath);
} else {
renderDashboard();
}
} catch (e) {
console.error('Dashboard render failed:', e);
}
// Global Escape key handler for modals
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
closeMarkdownModal();
// Close JSON modal if exists
const jsonModal = document.querySelector('.json-modal-overlay');
if (jsonModal) {
const closeBtn = jsonModal.querySelector('.json-modal-close');
if (closeBtn) closeJsonModal(closeBtn);
}
// Close path modal if exists
closePathModal();
// Close MCP create modal if exists
if (typeof closeMcpCreateModal === 'function') {
closeMcpCreateModal();
}
// Close Hook create modal if exists
if (typeof closeHookCreateModal === 'function') {
closeHookCreateModal();
}
}
});
});