diff --git a/containers/backupchecks/src/backend/app/main/routes_cove.py b/containers/backupchecks/src/backend/app/main/routes_cove.py index 2c44e21..b1fb7e9 100644 --- a/containers/backupchecks/src/backend/app/main/routes_cove.py +++ b/containers/backupchecks/src/backend/app/main/routes_cove.py @@ -28,6 +28,7 @@ _COVE_DATASOURCE_LABELS = { } _COVE_M365_CODES = {"D19", "D20", "D05", "D5", "D23"} +_COVE_SERVER_CODES = {"D02", "D2", "D10", "D11"} def _parse_cove_datasource_codes(raw: str | None) -> list[str]: @@ -39,11 +40,19 @@ def _parse_cove_datasource_codes(raw: str | None) -> list[str]: def _derive_backup_type_for_account(cove_acc: CoveAccount) -> str: - """Return Backupchecks-style backup type for a Cove account.""" + """Return Backupchecks-style backup type for a Cove account. + + Heuristic: + - M365 datasource present -> Microsoft 365 + - Server-specific datasource -> Server + - Otherwise -> Workstation + """ codes = set(_parse_cove_datasource_codes(getattr(cove_acc, "datasource_types", None))) if codes.intersection(_COVE_M365_CODES): return "Microsoft 365" - return "Servers/Workstations" + if codes.intersection(_COVE_SERVER_CODES): + return "Server" + return "Workstation" def _humanize_datasources(raw: str | None) -> str: diff --git a/containers/backupchecks/src/templates/main/cove_accounts.html b/containers/backupchecks/src/templates/main/cove_accounts.html index 3df1bd1..c39ed62 100644 --- a/containers/backupchecks/src/templates/main/cove_accounts.html +++ b/containers/backupchecks/src/templates/main/cove_accounts.html @@ -184,6 +184,7 @@ Backup software Type Job name + Computer Customer (Cove) Datasources Last status @@ -198,6 +199,7 @@ {{ acc.derived_backup_software }} {{ acc.derived_backup_type }} {{ acc.derived_job_name }} + {{ acc.computer_name or '—' }} {{ acc.customer_name or '—' }} {{ acc.datasource_display }}