]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/window/Backup.js
ui: guest import: add field for scsi controller
[pve-manager.git] / www / manager6 / window / Backup.js
index f768aee3ed672dcdd25c63f2958c056deaaf1a1d..4418a9c7e51fc41ee1b05f79d0913c3f34dc4897 100644 (file)
@@ -18,7 +18,7 @@ Ext.define('PVE.window.Backup', {
            throw "no VM type specified";
        }
 
-       let compressionSelector = Ext.create('PVE.form.CompressionSelector', {
+       let compressionSelector = Ext.create('PVE.form.BackupCompressionSelector', {
            name: 'compress',
            value: 'zstd',
            fieldLabel: gettext('Compression'),
@@ -36,6 +36,23 @@ Ext.define('PVE.window.Backup', {
            emptyText: Proxmox.Utils.noneText,
        });
 
+       let notificationModeSelector = Ext.create({
+           xtype: 'proxmoxKVComboBox',
+           comboItems: [
+               ['auto', gettext('Auto')],
+               ['legacy-sendmail', gettext('Email (legacy)')],
+               ['notification-system', gettext('Notification system')],
+           ],
+           fieldLabel: gettext('Notification mode'),
+           name: 'notification-mode',
+           value: 'auto',
+           listeners: {
+               change: function(field, value) {
+                   mailtoField.setDisabled(value === 'notification-system');
+               },
+           },
+       });
+
        const keepNames = [
            ['keep-last', gettext('Keep Last')],
            ['keep-hourly', gettext('Keep Hourly')],
@@ -110,9 +127,17 @@ Ext.define('PVE.window.Backup', {
                            if (!initialDefaults && data.mailto !== undefined) {
                                mailtoField.setValue(data.mailto);
                            }
+                           if (!initialDefaults && data['notification-mode'] !== undefined) {
+                               notificationModeSelector.setValue(data['notification-mode']);
+                           }
                            if (!initialDefaults && data.mode !== undefined) {
                                modeSelector.setValue(data.mode);
                            }
+                           if (!initialDefaults && (data['notes-template'] ?? false)) {
+                               me.down('field[name=notes-template]').setValue(
+                                   PVE.Utils.unEscapeNotesTemplate(data['notes-template']),
+                               );
+                           }
 
                            initialDefaults = true;
 
@@ -171,6 +196,7 @@ Ext.define('PVE.window.Backup', {
            ],
            column2: [
                compressionSelector,
+               notificationModeSelector,
                mailtoField,
                removeCheckbox,
            ],
@@ -251,6 +277,10 @@ Ext.define('PVE.window.Backup', {
                    params.mailto = values.mailto;
                }
 
+               if (values['notification-mode']) {
+                   params['notification-mode'] = values['notification-mode'];
+               }
+
                if (values.compress) {
                    params.compress = values.compress;
                }