fix: dedupe daily report Telegram in dual mode and show host in summary fallback

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-06-03 09:15:21 +10:00
parent 3053058cdf
commit 0d4a50cd35
4 changed files with 93 additions and 3 deletions
+9 -1
View File
@@ -405,7 +405,15 @@ def _format_event_body_html(event: Event) -> str:
return re.sub(r"\n{3,}", "\n\n", text)
body = _detail(details, "report_body", default=event.summary)
if body != "-":
return html.escape(body)
header = (
"📊 ЕЖЕДНЕВНЫЙ ОТЧЕТ МОНИТОРИНГА WINDOWS"
if event.type == "report.daily.rdp"
else "📊 ЕЖЕДНЕВНЫЙ ОТЧЕТ SSH МОНИТОРИНГА"
)
msg = f"<b>{html.escape(header)}</b>\n"
msg += _line("🏢", "Сервер", host_label(event.host))
msg += f"\n{html.escape(body)}"
return msg
return format_generic_event_html(event)
if event.type in ("rdp.login.success", "rdp.login.failed"):
return format_rdp_login_html(event)