Add statistics page with metrics, charts, and insights functionality

- Implemented CSS styles for the statistics page layout and components.
- Developed JavaScript functionality for managing statistics, including data fetching, chart rendering, and tab navigation.
- Created HTML template for the statistics page, integrating dynamic content for metrics, charts, and insights.
- Added responsive design adjustments and loading states for better user experience.
This commit is contained in:
Will Miao
2025-06-24 21:14:37 +08:00
parent 888896c0c0
commit 39d6d8d04a
11 changed files with 1915 additions and 11 deletions

View File

@@ -26,6 +26,7 @@ export class HeaderManager {
const path = window.location.pathname;
if (path.includes('/loras/recipes')) return 'recipes';
if (path.includes('/checkpoints')) return 'checkpoints';
if (path.includes('/statistics')) return 'statistics';
if (path.includes('/loras')) return 'loras';
return 'unknown';
}
@@ -121,14 +122,17 @@ export class HeaderManager {
});
}
// Handle help toggle
// const helpToggle = document.querySelector('.help-toggle');
// if (helpToggle) {
// helpToggle.addEventListener('click', () => {
// if (window.modalManager) {
// window.modalManager.toggleModal('helpModal');
// }
// });
// }
// Hide search functionality on Statistics page
this.updateHeaderForPage();
}
updateHeaderForPage() {
const headerSearch = document.getElementById('headerSearch');
if (this.currentPage === 'statistics' && headerSearch) {
headerSearch.style.display = 'none';
} else if (headerSearch) {
headerSearch.style.display = 'flex';
}
}
}