]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: tape backup: add selector for 'notification-mode'
authorLukas Wagner <l.wagner@proxmox.com>
Tue, 23 Apr 2024 11:52:15 +0000 (13:52 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Apr 2024 21:14:46 +0000 (23:14 +0200)
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Gabriel Goller <g.goller@proxmox.com>
Reviewed-by: Gabriel Goller <g.goller@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/tape/window/TapeBackup.js
www/tape/window/TapeBackupJob.js

index 941b6b836119b68200c3be7203af432bf39af9d0..a83853396dbedfab15dd3b3bd423d37f850a2a4f 100644 (file)
@@ -8,6 +8,15 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
     showTaskViewer: true,
     isCreate: true,
 
+    viewModel: {
+       data: {
+           notificationMode: 'notification-system',
+       },
+       formulas: {
+           notificationSystemSelected: (get) => get('notificationMode') === 'notification-system',
+       },
+    },
+
     items: [
        {
            xtype: 'inputpanel',
@@ -81,6 +90,19 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
                    name: 'eject-media',
                    fieldLabel: gettext('Eject Media'),
                },
+               {
+                   xtype: 'proxmoxKVComboBox',
+                   labelWidth: 150,
+                   comboItems: [
+                       ['legacy-sendmail', gettext('Email (legacy)')],
+                       ['notification-system', gettext('Notification system')],
+                   ],
+                   fieldLabel: gettext('Notification mode'),
+                   name: 'notification-mode',
+                   bind: {
+                       value: '{notificationMode}',
+                   },
+               },
                {
                    xtype: 'pmxUserSelector',
                    labelWidth: 150,
@@ -90,6 +112,9 @@ Ext.define('PBS.TapeManagement.TapeBackupWindow', {
                    value: null,
                    allowBlank: true,
                    skipEmptyText: true,
+                   bind: {
+                       disabled: "{notificationSystemSelected}",
+                   },
                    renderer: Ext.String.htmlEncode,
                },
            ],
index 309dda0bb82dfad5834e16945283b2a836c78613..12623712ac9f5a3c5cbf10c6cfa61c65537c7a59 100644 (file)
@@ -48,13 +48,21 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
 
     viewModel: {
        data: {
-           notificationMode: 'notification-system',
+           notificationMode: '__default__',
        },
        formulas: {
            notificationSystemSelected: (get) => get('notificationMode') === 'notification-system',
        },
     },
 
+    initComponent: function() {
+       let me = this;
+       // Automatically select the new system for new jobs
+       let mode = me.isCreate ? "notification-system" : "__default__";
+       me.getViewModel().set('notificationMode', mode);
+       me.callParent();
+    },
+
     items: {
        xtype: 'tabpanel',
        bodyPadding: 10,
@@ -121,6 +129,7 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', {
                    {
                        xtype: 'proxmoxKVComboBox',
                        comboItems: [
+                           ['__default__', `${Proxmox.Utils.defaultText}  (Email)`],
                            ['legacy-sendmail', gettext('Email (legacy)')],
                            ['notification-system', gettext('Notification system')],
                        ],