Skip to content

feat: scan history with device count and risk trend charts (#41) - #44

Merged
reloadfast merged 3 commits into
mainfrom
feat/scan-history-charts-41
Feb 28, 2026
Merged

reloadfast merged 3 commits into
mainfrom
feat/scan-history-charts-41

Conversation

@reloadfast

Copy link
Copy Markdown
Owner

Closes #41

Changes

Backend

  • Scan model — added risks_critical, risks_high, risks_medium, risks_low (Integer, nullable) columns
  • scan_runner.py — after run_all_checks(), counts risks by severity from DB and snapshots onto the Scan record
  • api/__init__.pyScanOut and _scan_to_out expose all four risk count fields

Frontend

  • HistoryPage (new) — pure-SVG charts (no third-party lib):
    • Bar chart: devices discovered per completed scan
    • Stacked bar chart: risk counts by severity per completed scan
    • Full scan table with all columns including per-severity risk counts
  • /history route added in main.tsx
  • History nav link added in Layout.tsx

Tests

  • test_run_scan_populates_risk_counts — asserts all four risk count fields are populated and ≥ 0 after a completed scan
  • test_scan_schema_fields — updated to assert all four risk count keys present in API response

reloadfast and others added 3 commits February 28, 2026 19:01
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>
@reloadfast
reloadfast merged commit be6b027 into main Feb 28, 2026
5 checks passed
@reloadfast
reloadfast deleted the feat/scan-history-charts-41 branch February 28, 2026 18:11
@reloadfast
reloadfast restored the feat/scan-history-charts-41 branch March 26, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: scan history view with device count and risk trend charts

1 participant