Add in-app notifications for new panel version availability

- Add notify_update_available() method to NotificationService
- Add translations for update notifications (ru/en)
- Add 'update' type to default notification types
- Add check_for_panel_updates() background task (runs every 6 hours)
- Notifications include link to settings page for easy update access
- Prevent duplicate notifications for same version
This commit is contained in:
2025-12-16 19:38:04 +05:00
parent 3113aa5905
commit aa8c06116d
5 changed files with 252 additions and 68 deletions

View File

@@ -59,7 +59,7 @@ class NotificationPreference(Base):
telegram_chat_id = Column(String(100))
webhook_url = Column(String(500))
notification_levels = Column(JSON, default=["critical", "warning", "info", "success"])
notification_types = Column(JSON, default=["vm_status", "resource_alert", "system"])
notification_types = Column(JSON, default=["vm_status", "resource_alert", "system", "update"])
quiet_hours_start = Column(String(5)) # HH:MM format
quiet_hours_end = Column(String(5)) # HH:MM format
created_at = Column(DateTime(timezone=True), server_default=func.now())