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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user