Differentiate Cove server/workstation types and show computer name
This commit is contained in:
parent
7803b7647c
commit
a0abd3d58e
@ -28,6 +28,7 @@ _COVE_DATASOURCE_LABELS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_COVE_M365_CODES = {"D19", "D20", "D05", "D5", "D23"}
|
_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]:
|
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:
|
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)))
|
codes = set(_parse_cove_datasource_codes(getattr(cove_acc, "datasource_types", None)))
|
||||||
if codes.intersection(_COVE_M365_CODES):
|
if codes.intersection(_COVE_M365_CODES):
|
||||||
return "Microsoft 365"
|
return "Microsoft 365"
|
||||||
return "Servers/Workstations"
|
if codes.intersection(_COVE_SERVER_CODES):
|
||||||
|
return "Server"
|
||||||
|
return "Workstation"
|
||||||
|
|
||||||
|
|
||||||
def _humanize_datasources(raw: str | None) -> str:
|
def _humanize_datasources(raw: str | None) -> str:
|
||||||
|
|||||||
@ -184,6 +184,7 @@
|
|||||||
<th>Backup software</th>
|
<th>Backup software</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Job name</th>
|
<th>Job name</th>
|
||||||
|
<th>Computer</th>
|
||||||
<th>Customer (Cove)</th>
|
<th>Customer (Cove)</th>
|
||||||
<th>Datasources</th>
|
<th>Datasources</th>
|
||||||
<th>Last status</th>
|
<th>Last status</th>
|
||||||
@ -198,6 +199,7 @@
|
|||||||
<td>{{ acc.derived_backup_software }}</td>
|
<td>{{ acc.derived_backup_software }}</td>
|
||||||
<td>{{ acc.derived_backup_type }}</td>
|
<td>{{ acc.derived_backup_type }}</td>
|
||||||
<td>{{ acc.derived_job_name }}</td>
|
<td>{{ acc.derived_job_name }}</td>
|
||||||
|
<td class="text-muted small">{{ acc.computer_name or '—' }}</td>
|
||||||
<td>{{ acc.customer_name or '—' }}</td>
|
<td>{{ acc.customer_name or '—' }}</td>
|
||||||
<td class="text-muted small">{{ acc.datasource_display }}</td>
|
<td class="text-muted small">{{ acc.datasource_display }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user