From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 4ADE61FF185 for ; Mon, 23 Jun 2025 16:13:16 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B639614284; Mon, 23 Jun 2025 16:13:44 +0200 (CEST) From: Lukas Wagner To: pbs-devel@lists.proxmox.com Date: Mon, 23 Jun 2025 16:13:15 +0200 Message-Id: <20250623141315.288681-11-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250623141315.288681-1-l.wagner@proxmox.com> References: <20250623141315.288681-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup 9/9] ui: datastore options: notification: use radio controls to select mode X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" This makes it consistent with tape backup job options and PVE's backup jobs. It also visualizes the dependency of 'notify' and 'notify-user' onto 'notification-mode'. Signed-off-by: Lukas Wagner --- www/window/NotifyOptions.js | 43 ++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/www/window/NotifyOptions.js b/www/window/NotifyOptions.js index 12a2e561..fc43de65 100644 --- a/www/window/NotifyOptions.js +++ b/www/window/NotifyOptions.js @@ -49,7 +49,8 @@ Ext.define('PBS.window.NotifyOptions', { notificationMode: '__default__', }, formulas: { - notificationSystemSelected: (get) => get('notificationMode') === 'notification-system', + notificationSystemSelected: (get) => + get('notificationMode')['notification-mode'] === 'notification-system', }, }, @@ -74,23 +75,36 @@ Ext.define('PBS.window.NotifyOptions', { }, items: [ { - xtype: 'proxmoxKVComboBox', - comboItems: [ - ['__default__', `${Proxmox.Utils.defaultText} (Email)`], - ['legacy-sendmail', gettext('Email (legacy)')], - ['notification-system', gettext('Notification system')], - ], - deleteEmpty: true, - fieldLabel: gettext('Notification mode'), - name: 'notification-mode', + xtype: 'radiogroup', + height: '15px', + layout: { + type: 'vbox', + }, bind: { value: '{notificationMode}', }, + items: [ + { + xtype: 'radiofield', + name: 'notification-mode', + inputValue: 'notification-system', + boxLabel: gettext('Use global notification settings'), + cbind: { + checked: '{isCreate}', + }, + }, + { + xtype: 'radiofield', + name: 'notification-mode', + inputValue: 'legacy-sendmail', + boxLabel: gettext('Use sendmail to send an email (legacy)'), + }, + ], }, { xtype: 'pmxUserSelector', name: 'notify-user', - fieldLabel: gettext('Notify User'), + fieldLabel: gettext('Recipient'), emptyText: 'root@pam', value: null, allowBlank: true, @@ -99,6 +113,7 @@ Ext.define('PBS.window.NotifyOptions', { bind: { disabled: '{notificationSystemSelected}', }, + padding: '0 0 0 50', }, { xtype: 'pbsNotifyType', @@ -109,6 +124,7 @@ Ext.define('PBS.window.NotifyOptions', { bind: { disabled: '{notificationSystemSelected}', }, + padding: '0 0 0 50', }, { xtype: 'pbsNotifyType', @@ -119,6 +135,7 @@ Ext.define('PBS.window.NotifyOptions', { bind: { disabled: '{notificationSystemSelected}', }, + padding: '0 0 0 50', }, { xtype: 'pbsNotifyErrorDefaultType', @@ -129,6 +146,7 @@ Ext.define('PBS.window.NotifyOptions', { bind: { disabled: '{notificationSystemSelected}', }, + padding: '0 0 0 50', }, { xtype: 'pbsNotifyType', @@ -139,6 +157,7 @@ Ext.define('PBS.window.NotifyOptions', { bind: { disabled: '{notificationSystemSelected}', }, + padding: '0 0 0 50', }, ], }, @@ -151,7 +170,7 @@ Ext.define('PBS.window.NotifyOptions', { 'verify-new': values['verify-new'], 'notification-mode': values['notification-mode'] ? values['notification-mode'] - : '__default__', + : 'notification-system', }; let notify = {}; -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel