diff --git a/app/templates/admin/settings.html b/app/templates/admin/settings.html index d6e1890e..3450d67e 100644 --- a/app/templates/admin/settings.html +++ b/app/templates/admin/settings.html @@ -21,6 +21,7 @@ {{ tab_button('logging', 'Logging', icon='document-text') }} {{ tab_button('system', 'System', icon='cog') }} {{ tab_button('security', 'Security', icon='shield-check') }} + {{ tab_button('notifications', 'Notifications', icon='bell') }} {% endcall %} @@ -187,6 +188,80 @@ + +
+
+

+ Notification Settings +

+

+ Configure platform notification preferences and delivery channels. +

+ + +
+
+ +
+

+ For detailed notification management including templates and delivery logs, visit the full + Notifications page + in Platform Monitoring. +

+
+
+
+ + +
+
+
+

Email Notifications

+

Send notification emails for important events

+
+ +
+ +
+
+

In-App Notifications

+

Show notifications in the admin interface

+
+ +
+ +
+
+

Critical Alerts Only

+

Only receive notifications for critical system events

+
+ +
+
+ + +
+ +
+
+
+ {% endblock %} {% block extra_scripts %} diff --git a/static/admin/js/settings.js b/static/admin/js/settings.js index e120a804..13ed6531 100644 --- a/static/admin/js/settings.js +++ b/static/admin/js/settings.js @@ -25,6 +25,11 @@ function adminSettings() { file_logging_enabled: true, db_logging_enabled: true }, + notificationSettings: { + email_enabled: true, + in_app_enabled: true, + critical_only: false + }, async init() { try { @@ -105,6 +110,32 @@ function adminSettings() { settingsLog.error('Failed to cleanup logs:', error); this.error = error.response?.data?.detail || 'Failed to cleanup old logs'; } + }, + + async saveNotificationSettings() { + this.saving = true; + this.error = null; + this.successMessage = null; + + try { + // TODO: Implement API endpoint for notification settings + // const data = await apiClient.put('/admin/notifications/settings', this.notificationSettings); + + // For now, just show success (settings are client-side only) + this.successMessage = 'Notification settings saved successfully'; + + // Auto-hide success message after 5 seconds + setTimeout(() => { + this.successMessage = null; + }, 5000); + + settingsLog.info('Notification settings saved:', this.notificationSettings); + } catch (error) { + settingsLog.error('Failed to save notification settings:', error); + this.error = error.response?.data?.detail || 'Failed to save notification settings'; + } finally { + this.saving = false; + } } }; }