feat: scan history with device count and risk trend charts (#41) - #44
Merged
Merged
Conversation
Backend: - Add risks_critical/high/medium/low columns to Scan model - Populate risk counts in scan_runner after run_all_checks - Expose risk count fields in ScanOut / GET /api/scans Frontend: - HistoryPage with pure-SVG bar chart (devices) and stacked bar chart (risks) - Full scan table with per-severity risk columns - /history route added; History added to nav Tests: - test_run_scan_populates_risk_counts asserts all four count fields non-negative - test_scan_schema_fields updated to assert risk count keys in scan response Closes #41 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
Changes
Backend
Scanmodel — addedrisks_critical,risks_high,risks_medium,risks_low(Integer, nullable) columnsscan_runner.py— afterrun_all_checks(), counts risks by severity from DB and snapshots onto the Scan recordapi/__init__.py—ScanOutand_scan_to_outexpose all four risk count fieldsFrontend
HistoryPage(new) — pure-SVG charts (no third-party lib):/historyroute added inmain.tsxLayout.tsxTests
test_run_scan_populates_risk_counts— asserts all four risk count fields are populated and ≥ 0 after a completed scantest_scan_schema_fields— updated to assert all four risk count keys present in API response