mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
Remove backup HTML template for workflow dashboard
This commit is contained in:
40
ccw/src/templates/dashboard-js/main.js
Normal file
40
ccw/src/templates/dashboard-js/main.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// 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); }
|
||||
|
||||
// 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();
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user