From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2 2/3] ui: one-shot backup: remove 'auto' notification mode for clarity
Date: Tue, 17 Jun 2025 10:44:47 +0200 [thread overview]
Message-ID: <20250617084448.87536-2-l.wagner@proxmox.com> (raw)
In-Reply-To: <20250617084448.87536-1-l.wagner@proxmox.com>
The 'auto' mode does not really add any functionality but only adds
confusion about what it actually does, so it is completely removed from
the UI. It is still supported by the backend, but in the UI it is mapped
it to a concrete mode (either notification-system or legacy-sendmail,
depending on whether mailto is set).
The term 'Notification System' is completely dropped from the UI,
instead 'Global Notification Settings' is used.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Michael Köppl <m.koeppl@proxmox.com>
Reviewed-by: Michael Köppl <m.koeppl@proxmox.com>
---
Notes:
Changeslog:
v2:
- Some rephrasing in the commit message
- Fixed typo in 'Recipients'
www/manager6/window/Backup.js | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/www/manager6/window/Backup.js b/www/manager6/window/Backup.js
index 70b51409..4377cb5f 100644
--- a/www/manager6/window/Backup.js
+++ b/www/manager6/window/Backup.js
@@ -33,22 +33,22 @@ Ext.define('PVE.window.Backup', {
let mailtoField = Ext.create('Ext.form.field.Text', {
fieldLabel: gettext('Send email to'),
name: 'mailto',
+ hidden: true,
emptyText: Proxmox.Utils.noneText,
});
let notificationModeSelector = Ext.create({
xtype: 'proxmoxKVComboBox',
comboItems: [
- ['auto', gettext('Auto')],
- ['legacy-sendmail', gettext('Email (legacy)')],
- ['notification-system', gettext('Notification system')],
+ ['notification-system', gettext('Use global settings')],
+ ['legacy-sendmail', gettext('Use sendmail (legacy)')],
],
- fieldLabel: gettext('Notification mode'),
+ fieldLabel: gettext('Notification'),
name: 'notification-mode',
- value: 'auto',
+ value: 'notification-system',
listeners: {
change: function(field, value) {
- mailtoField.setDisabled(value === 'notification-system');
+ mailtoField.setHidden(value === 'notification-system');
},
},
});
@@ -170,11 +170,21 @@ Ext.define('PVE.window.Backup', {
success: function(response, opts) {
const data = response.result.data;
- if (!initialDefaults && data.mailto !== undefined) {
- mailtoField.setValue(data.mailto);
- }
- if (!initialDefaults && data['notification-mode'] !== undefined) {
- notificationModeSelector.setValue(data['notification-mode']);
+ if (!initialDefaults) {
+ let notificationMode = data['notification-mode'] ?? 'auto';
+ let mailto = data.mailto;
+
+ if (notificationMode === 'auto' && mailto !== undefined) {
+ notificationMode = 'legacy-sendmail';
+ }
+ if (notificationMode === 'auto' && mailto === undefined) {
+ notificationMode = 'notification-system';
+ }
+
+ notificationModeSelector.setValue(notificationMode);
+ if (mailto !== undefined) {
+ mailtoField.setValue(mailto);
+ }
}
if (!initialDefaults && data.mode !== undefined) {
modeSelector.setValue(data.mode);
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-06-17 8:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 8:44 [pve-devel] [PATCH manager v2 1/3] ui: backup job edit: move notification related settings to separate tab Lukas Wagner
2025-06-17 8:44 ` Lukas Wagner [this message]
2025-06-17 8:44 ` [pve-devel] [PATCH manager v2 3/3] ui: oneshot backup: stop shifting UI when selecting 'legacy-sendmail' Lukas Wagner
2025-06-24 12:01 ` [pve-devel] superseded: [PATCH manager v2 1/3] ui: backup job edit: move notification related settings to separate tab Lukas Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250617084448.87536-2-l.wagner@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal