From 985397afa134d0ee7a1e0883f192aa950533f44c Mon Sep 17 00:00:00 2001 From: Ivo Oskamp Date: Sun, 4 Jan 2026 12:11:00 +0100 Subject: [PATCH] Auto-commit local changes before build (2026-01-04 12:11:00) --- .last-branch | 2 +- .../src/backend/app/main/routes_reporting_api.py | 11 +++++++---- docs/changelog.md | 9 +++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.last-branch b/.last-branch index 225e42e..7f51ecc 100644 --- a/.last-branch +++ b/.last-branch @@ -1 +1 @@ -v20260104-02-reports-html-content-and-success-rate-basis +v20260104-03-reports-html-view-selection-fix diff --git a/containers/backupchecks/src/backend/app/main/routes_reporting_api.py b/containers/backupchecks/src/backend/app/main/routes_reporting_api.py index bcc7bf9..8eca7bf 100644 --- a/containers/backupchecks/src/backend/app/main/routes_reporting_api.py +++ b/containers/backupchecks/src/backend/app/main/routes_reporting_api.py @@ -1092,18 +1092,21 @@ def _export_html_response(report: ReportDefinition, report_id: int, view: str): html_content = (pres.get("html_content") or "").strip().lower() or None # Default behavior: - # - single customer: jobs (snapshot preview) is more useful - # - multiple/all: customers table is useful + # - honor selected view: Summary should not show Snapshot rows unless explicitly requested + # - when html_content is not set, pick a sensible default based on scope + view scope = (getattr(report, "customer_scope", None) or "all").strip().lower() if not html_content: - html_content = "jobs" if scope == "single" else "customers" + if scope == "single" and (view or "summary").strip().lower() == "summary": + html_content = "customers" + else: + html_content = "jobs" if scope == "single" else "customers" include_customers = html_content in ("customers", "both") include_jobs = html_content in ("jobs", "both") # Snapshot preview table can be requested either explicitly via view=snapshot # or via the report config (include_jobs). - want_snapshot_table = (view or "summary").strip().lower() == "snapshot" or include_jobs + want_snapshot_table = (view or "summary").strip().lower() == "snapshot" snapshot_table_html = "" if want_snapshot_table: diff --git a/docs/changelog.md b/docs/changelog.md index 4bca3b4..6997087 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -200,6 +200,15 @@ - Excluded non-selected statuses (such as Missed runs) from success rate calculations to avoid distorted results. - Aligned success rate logic consistently across HTML output, PDF summaries, and report statistics. +--- + +## v20260104-03-reports-html-view-selection-fix + +- Fixed HTML report generation to correctly respect the selected report view. +- When "Summary" is selected, the HTML output now renders the summary content instead of the snapshot with individual runs. +- Prevented unintended fallback to Snapshot view when generating HTML reports. +- Improved default behavior for single-customer summary reports to ensure a meaningful summary is displayed. + ================================================================================================================================================ ## v0.1.15