From ca7134e61020d6e5e929aca05d0820a34557ac2f Mon Sep 17 00:00:00 2001 From: MacRimi Date: Thu, 2 Apr 2026 17:20:02 +0200 Subject: [PATCH] Update notification_templates.py --- AppImage/scripts/notification_templates.py | 76 ++-------------------- 1 file changed, 7 insertions(+), 69 deletions(-) diff --git a/AppImage/scripts/notification_templates.py b/AppImage/scripts/notification_templates.py index b1c5b79a..8226d5d3 100644 --- a/AppImage/scripts/notification_templates.py +++ b/AppImage/scripts/notification_templates.py @@ -1001,7 +1001,7 @@ EVENT_GROUPS = { } -# ─── Template Renderer ─��───────────────────────────────────────── +# ─── Template Renderer ─────────────────────────────────────────── def _get_hostname() -> str: """Get short hostname for message titles.""" @@ -1620,75 +1620,13 @@ BODY EMOJIS: BLANK LINES: Insert between logical sections (VM entries, before summary, before packages block). -═══ EXAMPLES (follow these formats) ═══ +═══ FORMATTING RULES ═══ -IMPORTANT: {hostname} is a placeholder. Always use the ACTUAL hostname from the original message. - -BACKUP START: -[TITLE] -💾🚀 {hostname}: Backup started -[BODY] -Backup job starting on storage PBS. -🏷️ VMs: web01 (100) - -🗄️ Storage: PBS | ⚙️ Mode: stop - -BACKUP COMPLETE: -[TITLE] -💾✅ {hostname}: Backup complete -[BODY] -Backup job finished on storage local-bak. - -🏷️ VM web01 (ID: 100) -✔️ Status: ok -💽 Size: 12.3 GiB -⏱️ Duration: 00:04:21 -🗄️ Storage: vm/100/2026-03-17T22:00:08Z - -📊 Total: 1 backup | 💾 12.3 GiB | ⏱️ 00:04:21 - -BACKUP PARTIAL FAIL: -[TITLE] -💾❌ {hostname}: Backup partially failed -[BODY] -Backup job finished with errors. - -🏷️ VM web01 (ID: 100) -✔️ Status: ok -💽 Size: 12.3 GiB - -🏷️ VM broken (ID: 102) -❌ Status: error - -📊 Total: 2 backups | ❌ 1 failed - -UPDATES: -[TITLE] -📦 {hostname}: Updates available -[BODY] -📦 Total updates: 24 -🔒 Security updates: 6 -🔄 Proxmox updates: 0 - -🗂️ Important packages: -• none - -VM/CT START: -[TITLE] -🚀 {hostname}: VM arch-linux (100) started -[BODY] -🏷️ Virtual machine arch-linux (ID: 100) -✔️ Now running - -HEALTH DEGRADED: -[TITLE] -⚠️ {hostname}: Health warning — Disk I/O -[BODY] -💿 Device: /dev/sda -⚠️ 1 sector unreadable (pending) -📝 Log: process crashed (exit-code 255) -⚠️ Recurring: 5 times in 24h -💡 Tip: Run 'systemctl status pvedaemon'""" +1. USE THE INPUT MESSAGE AS YOUR BASE: The original message already has the correct structure, hostname, and data. +2. PRESERVE ALL ORIGINAL DATA: Keep hostname, VM/CT names, IDs, sizes, durations exactly as provided. +3. ENHANCE, DON'T REPLACE: Add emojis for visual clarity using the icons above, but maintain the original structure. +4. ADD CONTEXT IF PROVIDED: If additional context (logs, known errors, suggestions) is provided, append it using appropriate icons. +5. NEVER INVENT FACTS: Do not invent hostnames, IDs, sizes, or technical data. Suggestions and tips based on provided context are allowed.""" # No emoji instructions for email/plain text channels