all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings
@ 2025-06-12  9:55 Lukas Wagner
  2025-06-12  9:55 ` [pve-devel] [PATCH manager 2/2] ui: backup job details: show notification-mode instead of legacy keys Lukas Wagner
  2025-06-24 11:30 ` [pve-devel] superseded: [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings Lukas Wagner
  0 siblings, 2 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-06-12  9:55 UTC (permalink / raw)
  To: pve-devel

These were only used in the 'old' revamped notification stack which was
briefly available on pvetest. With PVE 9 we can finally get completely
rid of these.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
Only intended for PVE 9.

 www/manager6/dc/Backup.js | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 381402ca..688befe7 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -37,14 +37,6 @@ Ext.define('PVE.dc.BackupEdit', {
 		delete values.node;
 	    }
 
-	    // Get rid of new-old parameters for notification settings.
-	    // These should only be set for those selected few who ran
-	    // pve-manager from pvetest.
-	    if (!isCreate) {
-		Proxmox.Utils.assemble_field_data(values, { 'delete': 'notification-policy' });
-		Proxmox.Utils.assemble_field_data(values, { 'delete': 'notification-target' });
-	    }
-
 	    let selMode = values.selMode;
 	    delete values.selMode;
 
@@ -158,14 +150,6 @@ Ext.define('PVE.dc.BackupEdit', {
 	    let me = this;
 	    let viewModel = me.getViewModel();
 
-	    // Migrate 'new'-old notification-policy back to old-old mailnotification.
-	    // Only should affect users who used pve-manager from pvetest. This was a remnant of
-	    // notifications before the  overhaul.
-	    let policy = data['notification-policy'];
-	    if (policy === 'always' || policy === 'failure') {
-		data.mailnotification = policy;
-	    }
-
 	    if (data.exclude) {
 		data.vmid = data.exclude;
 		data.selMode = 'exclude';
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH manager 2/2] ui: backup job details: show notification-mode instead of legacy keys
  2025-06-12  9:55 [pve-devel] [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings Lukas Wagner
@ 2025-06-12  9:55 ` Lukas Wagner
  2025-06-24 11:30 ` [pve-devel] superseded: [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings Lukas Wagner
  1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-06-12  9:55 UTC (permalink / raw)
  To: pve-devel

The backup job details view was never updated after the overhaul of the
notification system. In this commit we remove the left-over
notification-policy/target handling and change the view so that we
display the current configuration based on notification-mode, mailto and
mailnotification.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
Only intended for PVE 9.

 www/manager6/dc/BackupJobDetail.js | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/www/manager6/dc/BackupJobDetail.js b/www/manager6/dc/BackupJobDetail.js
index 85bb036a..f80d5ef7 100644
--- a/www/manager6/dc/BackupJobDetail.js
+++ b/www/manager6/dc/BackupJobDetail.js
@@ -202,27 +202,27 @@ Ext.define('PVE.dc.BackupInfo', {
     column2: [
 	{
 	    xtype: 'displayfield',
-	    name: 'notification-policy',
+	    name: 'notification-mode',
 	    fieldLabel: gettext('Notification'),
 	    renderer: function(value) {
+		value = value ?? 'auto';
 		let record = this.up('pveBackupInfo')?.record;
+		let mailto = record?.mailto;
+		let mailnotification = record?.mailnotification ?? 'always';
 
-		// Fall back to old value, in case this option is not migrated yet.
-		let policy = value || record?.mailnotification || 'always';
+		if ((value === 'auto' && mailto === undefined) || value === 'notification-system') {
+		    return gettext('Use global notification settings');
+		} else {
+		    if (mailto === undefined) {
+			mailto = '-';
+		    }
 
-		let when = gettext('Always');
-		if (policy === 'failure') {
-		    when = gettext('On failure only');
-		} else if (policy === 'never') {
-		    when = gettext('Never');
+		    if (mailnotification === 'always') {
+			return Ext.String.format(gettext('Always use sendmail to send an email to: {0}'), mailto);
+		    } else {
+			return Ext.String.format(gettext('On failure, use sendmail to send an email to: {0}'), mailto);
+		    }
 		}
-
-		// Notification-target takes precedence
-		let target = record?.['notification-target'] ||
-		    record?.mailto ||
-		    gettext('No target configured');
-
-		return `${when} (${target})`;
 	    },
 	},
 	{
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] superseded: [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings
  2025-06-12  9:55 [pve-devel] [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings Lukas Wagner
  2025-06-12  9:55 ` [pve-devel] [PATCH manager 2/2] ui: backup job details: show notification-mode instead of legacy keys Lukas Wagner
@ 2025-06-24 11:30 ` Lukas Wagner
  1 sibling, 0 replies; 3+ messages in thread
From: Lukas Wagner @ 2025-06-24 11:30 UTC (permalink / raw)
  To: pve-devel

Superseded-by:
https://lore.proxmox.com/all/20250624112817.132312-1-l.wagner@proxmox.com/T/#t

On  2025-06-12 11:55, Lukas Wagner wrote:
> These were only used in the 'old' revamped notification stack which was
> briefly available on pvetest. With PVE 9 we can finally get completely
> rid of these.
> 
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
> ---
> Only intended for PVE 9.
> 
>  www/manager6/dc/Backup.js | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
> index 381402ca..688befe7 100644
> --- a/www/manager6/dc/Backup.js
> +++ b/www/manager6/dc/Backup.js
> @@ -37,14 +37,6 @@ Ext.define('PVE.dc.BackupEdit', {
>  		delete values.node;
>  	    }
>  
> -	    // Get rid of new-old parameters for notification settings.
> -	    // These should only be set for those selected few who ran
> -	    // pve-manager from pvetest.
> -	    if (!isCreate) {
> -		Proxmox.Utils.assemble_field_data(values, { 'delete': 'notification-policy' });
> -		Proxmox.Utils.assemble_field_data(values, { 'delete': 'notification-target' });
> -	    }
> -
>  	    let selMode = values.selMode;
>  	    delete values.selMode;
>  
> @@ -158,14 +150,6 @@ Ext.define('PVE.dc.BackupEdit', {
>  	    let me = this;
>  	    let viewModel = me.getViewModel();
>  
> -	    // Migrate 'new'-old notification-policy back to old-old mailnotification.
> -	    // Only should affect users who used pve-manager from pvetest. This was a remnant of
> -	    // notifications before the  overhaul.
> -	    let policy = data['notification-policy'];
> -	    if (policy === 'always' || policy === 'failure') {
> -		data.mailnotification = policy;
> -	    }
> -
>  	    if (data.exclude) {
>  		data.vmid = data.exclude;
>  		data.selMode = 'exclude';

-- 
- Lukas



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-24 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-12  9:55 [pve-devel] [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings Lukas Wagner
2025-06-12  9:55 ` [pve-devel] [PATCH manager 2/2] ui: backup job details: show notification-mode instead of legacy keys Lukas Wagner
2025-06-24 11:30 ` [pve-devel] superseded: [PATCH manager 1/2] ui: remove handling of obsolete notification-policy/target settings Lukas Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal