[Admin] Notification channel toggles (web/SMS/push active-deactive)
Add a 'notification channels' card at the top of admin Settings with three master on/off checkboxes: web/in-app (new WebNotificationsEnabled, default true), SMS (existing SmsEnabled), and Web Push (existing PushEnabled). Removed the duplicate enable checkboxes from the SMS and Push sections so each binds once. NotificationService now gates the in-app + live SSE channel on WebNotificationsEnabled; push self-gates on PushEnabled. Migration defaults the new column to true so existing installs keep web notifications on. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,11 @@ public class AppSetting
|
||||
/// (Google Maps is blocked in Iran). Empty → only the "my location" button is shown.</summary>
|
||||
[MaxLength(200)] public string? NeshanMapKey { get; set; }
|
||||
|
||||
// --- Notification channels (master on/off, controlled from the admin panel) ---
|
||||
/// <summary>Live in-app / web notifications (SSE bell + toast + local OS popup). Works in Iran
|
||||
/// because it streams over our own origin — no external push service. On by default.</summary>
|
||||
public bool WebNotificationsEnabled { get; set; } = true;
|
||||
|
||||
// --- Web Push (PWA notifications). VAPID keypair; generate once with the web-push tooling. ---
|
||||
public bool PushEnabled { get; set; } = false;
|
||||
[MaxLength(200)] public string? VapidPublicKey { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user