display tag fro alterts, cleanup udp

This commit is contained in:
Andreas Wrede
2026-04-01 11:49:55 -04:00
parent dd23d9d163
commit 079e84f729
15 changed files with 277 additions and 540 deletions
+4 -4
View File
@@ -9,9 +9,11 @@ import logging
from aiohttp import web
import jinja2
from . import data
from . import notify as notify_mod
logger = logging.getLogger(__name__)
eventlog = notify_mod.eventlog
def _render_template(html_str: str, **context) -> str:
tmpl = jinja2.Template(html_str)
@@ -92,8 +94,7 @@ async def start(
return web.Response(status=400, text="need h= argument")
if uname not in hbdclass.Host.hosts:
return web.Response(status=400, text=f"h={uname} not found")
if log:
log(uname, "dropped")
eventlog(uname, "INFO", "dropped")
del hbdclass.Host.hosts[uname]
return web.Response(text="Done")
@@ -105,8 +106,7 @@ async def start(
if uname not in hbdclass.Host.hosts:
return web.Response(status=400, text=f"h={uname} not found")
ll = hbdclass.Host.hosts[uname].registerDns()
if log:
log(uname, ll)
eventlog(uname, "INFO", ll)
return web.Response(text=str(ll))
async def update(request):