]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/window/Backup.js
ui: bulk shutdown: expose new timeout and force-stop to user
[pve-manager.git] / www / manager6 / window / Backup.js
index 77be6cafbaf37c4686b9fe33747e26da68b8304e..4b21c746ce987a06bc2a64834b3baa30660c211f 100644 (file)
@@ -65,6 +65,7 @@ Ext.define('PVE.window.Backup', {
            },
            handler: function(checkbox, value) {
                pruneSettings.forEach(field => field.setHidden(!value));
+               me.down('label[name="pruneLabel"]').setHidden(!value);
            },
        });
 
@@ -112,6 +113,11 @@ Ext.define('PVE.window.Backup', {
                            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;
 
@@ -153,51 +159,85 @@ Ext.define('PVE.window.Backup', {
            },
        });
 
+       let protectedCheckbox = Ext.create('Proxmox.form.Checkbox', {
+           name: 'protected',
+           checked: false,
+           uncheckedValue: 0,
+           fieldLabel: gettext('Protected'),
+       });
+
        me.formPanel = Ext.create('Proxmox.panel.InputPanel', {
            bodyPadding: 10,
            border: false,
            column1: [
                storagesel,
                modeSelector,
-               removeCheckbox,
+               protectedCheckbox,
            ],
            column2: [
                compressionSelector,
                mailtoField,
+               removeCheckbox,
            ],
-           columnB: [{
-               layout: 'hbox',
-               border: false,
-               defaults: {
-                   border: false,
-                   layout: 'anchor',
-                   flex: 1,
+           columnB: [
+               {
+                   xtype: 'textareafield',
+                   name: 'notes-template',
+                   fieldLabel: gettext('Notes'),
+                   anchor: '100%',
+                   value: '{{guestname}}',
                },
-               items: [
-                   {
-                       padding: '0 10 0 0',
-                       defaults: {
-                           labelWidth: 110,
-                       },
-                       items: [
-                           pruneSettings[0],
-                           pruneSettings[2],
-                           pruneSettings[4],
-                       ],
+               {
+                   xtype: 'box',
+                   style: {
+                       margin: '8px 0px',
+                       'line-height': '1.5em',
                    },
-                   {
-                       padding: '0 0 0 10',
-                       defaults: {
-                           labelWidth: 110,
-                       },
-                       items: [
-                           pruneSettings[1],
-                           pruneSettings[3],
-                           pruneSettings[5],
-                       ],
+                   html: Ext.String.format(
+                       gettext('Possible template variables are: {0}'),
+                       PVE.Utils.notesTemplateVars.map(v => `<code>{{${v}}}</code>`).join(', '),
+                   ),
+               },
+               {
+                   xtype: 'label',
+                   name: 'pruneLabel',
+                   text: gettext('Storage Retention Configuration') + ':',
+                   hidden: true,
+               },
+               {
+                   layout: 'hbox',
+                   border: false,
+                   defaults: {
+                       border: false,
+                       layout: 'anchor',
+                       flex: 1,
                    },
-               ],
-           }],
+                   items: [
+                       {
+                           padding: '0 10 0 0',
+                           defaults: {
+                               labelWidth: 110,
+                           },
+                           items: [
+                               pruneSettings[0],
+                               pruneSettings[2],
+                               pruneSettings[4],
+                           ],
+                       },
+                       {
+                           padding: '0 0 0 10',
+                           defaults: {
+                               labelWidth: 110,
+                           },
+                           items: [
+                               pruneSettings[1],
+                               pruneSettings[3],
+                               pruneSettings[5],
+                           ],
+                       },
+                   ],
+               },
+           ],
        });
 
        var submitBtn = Ext.create('Ext.Button', {
@@ -220,6 +260,15 @@ Ext.define('PVE.window.Backup', {
                    params.compress = values.compress;
                }
 
+               if (values.protected) {
+                   params.protected = values.protected;
+               }
+
+               if (values['notes-template']) {
+                   params['notes-template'] = PVE.Utils.escapeNotesTemplate(
+                       values['notes-template']);
+               }
+
                Proxmox.Utils.API2Request({
                    url: '/nodes/' + me.nodename + '/vzdump',
                    params: params,
@@ -263,6 +312,7 @@ Ext.define('PVE.window.Backup', {
            modal: true,
            layout: 'auto',
            border: false,
+           width: 600,
            items: [me.formPanel],
            buttons: [helpBtn, '->', submitBtn],
            listeners: {