diff --git a/dashboard.py b/dashboard.py index 75871d5..b3103e9 100644 --- a/dashboard.py +++ b/dashboard.py @@ -17,6 +17,21 @@ def _fmt_dt(dt: datetime | None) -> str: return str(dt) +HTML_TEMPLATE = ( + "thc-webhook admin" + "" + "" + "

Admin: templates

" + "

Edits are saved to the templates JSON file on disk.

" + "{content}" + "" +) + + +def get_html_template(content) -> str: + return HTML_TEMPLATE.format(content=content) + + def create_app( *, get_state: Callable[[], dict], @@ -32,11 +47,7 @@ def create_app( locations = state.get("last_locations") or [] locations_html = "".join(f"
  • {loc}
  • " for loc in locations) - return ( - "" - "thc-webhook" - "" - "" + return get_html_template( "

    thc-webhook

    " "

    Status

    " "