]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: backup job detail view: merge mail notification when/to fields
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Sep 2021 14:09:40 +0000 (16:09 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Sep 2021 14:09:45 +0000 (16:09 +0200)
While it surely is nice to follow the layout of the job creation/edit
panel for sharing familiarity, it does not means that we need to show
the data 1:1, we can profit from the read-only fact and merge stuff a
bit, like the mail to/when field.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/dc/Backup.js

index 9c903e6df632f51df338afe4a8fb441fe94d09bd..74f896c4d45cad8cc23c5865b6b45bed22d1c294 100644 (file)
@@ -636,26 +636,17 @@ Ext.define('PVE.dc.BackupInfo', {
        },
     ],
     column2: [
-       {
-           xtype: 'displayfield',
-           name: 'mailto',
-           fieldLabel: gettext('Send email to'),
-       },
        {
            xtype: 'displayfield',
            name: 'mailnotification',
            fieldLabel: gettext('Email notification'),
            renderer: function(value) {
-               let msg;
-               switch (value) {
-                   case 'always':
-                       msg = gettext('Always');
-                       break;
-                   case 'failure':
-                       msg = gettext('On failure only');
-                       break;
+               let mailto = this.up('pveBackupInfo')?.record?.mailto || 'root@localhost';
+               let when = gettext('Always');
+               if (value === 'failure') {
+                   when = gettext('On failure only');
                }
-               return msg;
+               return `${when} (${mailto})`;
            },
        },
        {