Rename unspecified coverage table title
This commit is contained in:
@@ -82,6 +82,7 @@ TRANSLATIONS = {
|
||||
"missing_guests": "VM/CT non sauvegardees",
|
||||
"coverage_group": "Sauvegarde des VM/CT",
|
||||
"coverage_title": "Sauvegarde des VM/CT - {namespace}",
|
||||
"coverage_unspecified_title": "VM/CT non sauvegardée",
|
||||
"retention_group": "Retention des sauvegardes VM/CT",
|
||||
"retention_title": "Retention des sauvegardes VM/CT {server_name} - {namespace}",
|
||||
"issues": "Anomalies",
|
||||
@@ -116,6 +117,7 @@ TRANSLATIONS = {
|
||||
"missing_guests": "VM/CT without backup",
|
||||
"coverage_group": "VM/CT backups",
|
||||
"coverage_title": "VM/CT backups - {namespace}",
|
||||
"coverage_unspecified_title": "VM/CT without backup",
|
||||
"retention_group": "VM/CT backup retention",
|
||||
"retention_title": "VM/CT backup retention {server_name} - {namespace}",
|
||||
"issues": "Anomalies",
|
||||
|
||||
@@ -345,9 +345,7 @@ def build_coverage_sections(
|
||||
return [
|
||||
ReportSection(
|
||||
section_id="sauvegarde-vmct",
|
||||
title=translator.text("coverage_title").format(
|
||||
namespace=translator.cell("non renseigne")
|
||||
),
|
||||
title=coverage_section_title("non renseigne", translator),
|
||||
headers=coverage_headers_without_namespace(translator),
|
||||
rows=[],
|
||||
empty_message=translator.text("no_guest"),
|
||||
@@ -374,7 +372,7 @@ def build_coverage_sections(
|
||||
sections.append(
|
||||
ReportSection(
|
||||
section_id=f"sauvegarde-vmct-{section_id_fragment(namespace)}",
|
||||
title=translator.text("coverage_title").format(namespace=translator.cell(namespace)),
|
||||
title=coverage_section_title(namespace, translator),
|
||||
headers=coverage_headers_without_namespace(translator),
|
||||
rows=rows,
|
||||
empty_message=translator.text("no_guest"),
|
||||
@@ -384,6 +382,12 @@ def build_coverage_sections(
|
||||
return sections
|
||||
|
||||
|
||||
def coverage_section_title(namespace: str, translator: Translator) -> str:
|
||||
if namespace == "non renseigne":
|
||||
return translator.text("coverage_unspecified_title")
|
||||
return translator.text("coverage_title").format(namespace=translator.cell(namespace))
|
||||
|
||||
|
||||
def coverage_headers_without_namespace(translator: Translator) -> list[str]:
|
||||
return translator.row([
|
||||
"VMID",
|
||||
|
||||
Reference in New Issue
Block a user