Public: Hostname and CNAME target can be shared.
Secret: {escape(secret_items)} can update or manage this hostname.
Secrets are hidden on screen. Copy still copies the real value.
'
- + "".join(
- f'{escape(value)}{escape(label)}'
- for label, value in items
- )
+ + "".join(f"{escape(value)}{escape(label)}" for label, value in items)
+ "
"
)
@@ -181,12 +188,15 @@ def _server_page_links(admin_path: str, offset_name: str, offset: int, limit: in
def _cleanup_panel(
settings: DdnsSettings,
- cleanup_runs: list[dict[str, str | int]],
- scheduled_tasks: list[dict[str, str | int | None]],
+ cleanup_runs: Sequence[Mapping[str, object]],
+ scheduled_tasks: Sequence[Mapping[str, object]],
safe_admin_path: str,
csrf: str,
) -> SafeHtml:
- task = next((item for item in scheduled_tasks if item.get("name") == "cleanup"), scheduled_tasks[0] if scheduled_tasks else {})
+ task = next(
+ (item for item in scheduled_tasks if item.get("name") == "cleanup"),
+ scheduled_tasks[0] if scheduled_tasks else {},
+ )
last_run = task.get("last_finished_at") or (cleanup_runs[0].get("created_at") if cleanup_runs else None)
next_run = task.get("next_run_at")
status = task.get("last_status") or "pending"
@@ -235,14 +245,14 @@ def _metrics_panel(metrics: dict[str, float]) -> SafeHtml:
("Blocked requests", _metric_int(metrics.get("rate_limit_hits_total", 0))),
("Average update time", f"{average_latency:.1f} ms"),
("Last update time", f"{metrics.get('last_update_latency_ms', 0):.1f} ms"),
- ("Cleanup ok/errors", f"{_metric_int(metrics.get('cleanup_success_total', 0))}/{_metric_int(metrics.get('cleanup_errors_total', 0))}"),
+ (
+ "Cleanup ok/errors",
+ f"{_metric_int(metrics.get('cleanup_success_total', 0))}/{_metric_int(metrics.get('cleanup_errors_total', 0))}",
+ ),
]
- cards = "\n".join(
- f"""
+ cards = "\n".join(f"""
{escape(value)}{escape(label)}
- """
- for label, value in items
- )
+ """ for label, value in items)
return trusted(f"""