[pve-devel] [PATCH pve-manager 09/11] ui: notify: add system-mail settings, configuring mail forwarding

Lukas Wagner l.wagner at proxmox.com
Thu Aug 31 13:06:19 CEST 2023


The 'Notifications' panel in Datacenter view now features a new entry
'System mail', allowing the user to configure target and policy for
mails sent to the local root user.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 www/manager6/dc/NotificationEvents.js | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/www/manager6/dc/NotificationEvents.js b/www/manager6/dc/NotificationEvents.js
index f2ee12e0..81cbcb8b 100644
--- a/www/manager6/dc/NotificationEvents.js
+++ b/www/manager6/dc/NotificationEvents.js
@@ -241,6 +241,33 @@ Ext.define('PVE.dc.NotificationEvents', {
 	    ],
 	});
 
+	me.addInputPanelRow('system-mail', 'notify', gettext('System Mail'), {
+	    renderer: (value, metaData, record, rowIndex, colIndex, store) =>
+		render_value(store, 'target-system-mail', 'system-mail', gettext('Always')),
+	    url: "/api2/extjs/cluster/options",
+	    items: [
+		{
+		    xtype: 'pveNotificationEventsPolicySelector',
+		    name: 'system-mail',
+		    fieldLabel: gettext('Notify'),
+		    comboItems: [
+			['__default__', `${Proxmox.Utils.defaultText} (${gettext('Always')})`],
+			['always', gettext('Always')],
+			['never', gettext('Never')],
+		    ],
+		    warningRef: 'warning',
+		    warnIfValIs: 'never',
+		},
+		{
+		    xtype: 'pveNotificationEventsTargetSelector',
+		    name: 'target-system-mail',
+		},
+		{
+		    xtype: 'pveNotificationEventDisabledWarning',
+		    reference: 'warning',
+		},
+	    ],
+	});
 	// Hack: Also load the notify property to make it accessible
 	// for our render functions.
 	me.rows.notify = {
-- 
2.39.2






More information about the pve-devel mailing list