from __future__ import annotations
from .html_utils import SafeHtml, attr, escape, join_html, trusted
def _top_nav(label: str | None = None, links: SafeHtml | None = None) -> SafeHtml:
account_html = ""
if label:
account_html = f''
if links is None:
links = trusted('DocsAPI')
account_html += 'Generate'
theme_toggle = ''
return trusted(
f"""
Skip to content
"""
)
def _copy_row(label: str, value: str, sensitivity: str | None = None) -> SafeHtml:
safe_label = escape(label)
safe_value = escape(value)
badge = ""
is_secret = bool(sensitivity and sensitivity.lower() == "secret")
if sensitivity:
safe_sensitivity = escape(sensitivity)
badge_class = "text-bg-warning" if is_secret else "text-bg-secondary"
badge = f'{safe_sensitivity}'
value_field = (
f''
if is_secret
else f'{safe_value}'
)
reveal_button = (
f''
if is_secret
else ""
)
return trusted(
f"""
FRITZ!Box replaces <ipaddr> and <ip6addr>, then sends a GET request to the Update-URL. Scripts and other routers can do the same with curl. If no IP parameter is sent, KarlDNS uses the request source IP.
{safe_commands}
{_copy_button("Copy curl examples", commands)}