Commit Graph

8 Commits

Author SHA1 Message Date
656a6bfac4 Refactor dashboard data serialization and mock context for improved clarity
Some checks failed
CI / ci (push) Has been cancelled
- Introduced `serialize_audit_for_response` and `serialize_current_cluster_for_template` functions to handle JSON serialization of audit and cluster data, enhancing data consistency for API responses and template rendering.
- Updated `get_mock_context` in `mock_data.py` to utilize the new serialization functions, simplifying the mock data structure and improving readability.
- Refactored `collect_context` and `collect_audits` in `views.py` to leverage the new serialization methods, ensuring a cleaner and more maintainable codebase.
- Added unit tests for the new serialization functions to ensure correctness and reliability of data formatting.
2026-02-12 20:10:09 +03:00
6a27fecb13 Add dashboard statistics module and refactor views for metrics handling
All checks were successful
CI / ci (push) Successful in 14s
- Introduced a new `stats.py` module to encapsulate dashboard statistics building and cache key constants.
- Refactored `views.py` to utilize the new `build_stats` function for constructing metrics context, improving code organization and readability.
- Updated Prometheus query handling to streamline metrics fetching with a new `fetch_dashboard_metrics` function.
- Enhanced test cases to reflect changes in metrics fetching and context building, ensuring accurate functionality.
- Added new HTML templates for displaying detailed resource allocation and flavor statistics on the dashboard.
2026-02-07 18:39:28 +03:00
2a0e0c216a Refactor code for consistency and readability
Some checks failed
CI / ci (push) Failing after 14s
- Standardized string quotes across multiple files to use double quotes for consistency.
- Improved formatting of JSON dumps in mock data for better readability.
- Enhanced the structure of various functions and data definitions for clarity.
- Updated test cases to reflect changes in data structure and ensure accuracy.
2026-02-07 18:01:49 +03:00
fd03c22042 Add source status API and enhance dashboard with data source checks
- Introduced a new API endpoint `/api/source-status/` to return the status of Prometheus and OpenStack data sources.
- Implemented lightweight health check functions for both Prometheus and OpenStack.
- Updated the dashboard template to display the status of data sources dynamically.
- Added tests for the new API endpoint to ensure correct functionality and response handling.
- Configured a cache timeout for source status checks to improve performance.
2026-02-07 17:12:25 +03:00
917a7758bc Add DM Sans font integration and enhance dashboard context
- Added DM Sans font to the project, including multiple weights and styles for improved typography.
- Updated package.json and package-lock.json to include @fontsource/dm-sans dependency.
- Enhanced dashboard context to include current cluster CPU state, integrating new data into the context and API responses.
- Updated relevant templates and JavaScript to utilize the new current cluster data for better visualization and user experience.
2026-02-07 16:51:24 +03:00
30c08d497f Add API endpoints for stats and audits, implement data collection functions, and enhance index view with skeleton context 2026-02-06 17:21:00 +03:00
e3a9500352 Add tests for audits and flavor utilities, update .gitignore, and enhance CPU data handling 2026-02-06 16:29:34 +03:00
57a2933f28 Refactor Docker setup and add mock data support
- Updated .dockerignore and .gitignore for better file management.
- Introduced .env.example for environment variable configuration.
- Added docker-compose.dev.yml for development with mock data and live reload.
- Enhanced Dockerfile to include necessary dependencies and entrypoint script.
- Created mock_data.py to provide sample data for testing without OpenStack/Prometheus.
- Added unit tests for template filters in dashboard.
- Cleaned up various files for consistency and improved readability.
2026-02-06 16:12:21 +03:00