]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: rename pveEditPruneInputPanel to pveBackupJobPrunePanel
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Sep 2021 10:38:03 +0000 (12:38 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Sep 2021 10:56:15 +0000 (12:56 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/Makefile
www/manager6/dc/Backup.js
www/manager6/panel/BackupJobPrune.js [new file with mode: 0644]
www/manager6/panel/EditPruneInputPanel.js [deleted file]
www/manager6/storage/Base.js

index 3f81d9c4519546d27c398139809e9f7de71a92e1..aac780aae48edb9feca30b3982d92a2d722203c4 100644 (file)
@@ -79,7 +79,7 @@ JSSRC=                                                        \
        grid/Replication.js                             \
        grid/ResourceGrid.js                            \
        panel/ConfigPanel.js                            \
-       panel/EditPruneInputPanel.js                    \
+       panel/BackupJobPrune.js                         \
        panel/HealthWidget.js                           \
        panel/IPSet.js                                  \
        panel/NotesView.js                              \
index ff52e382276b47ea4e57632434f38b4a5a026b33..55222952b461aff3b1a7128568307a2913efa0e0 100644 (file)
@@ -368,7 +368,7 @@ Ext.define('PVE.dc.BackupEdit', {
                            ],
                        },
                        {
-                           xtype: 'pveEditPruneInputPanel',
+                           xtype: 'pveBackupJobPrunePanel',
                            title: gettext('Retention'),
                            isCreate: me.isCreate,
                            keepAllDefaultForCreate: false,
diff --git a/www/manager6/panel/BackupJobPrune.js b/www/manager6/panel/BackupJobPrune.js
new file mode 100644 (file)
index 0000000..a58fe1f
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Input panel for prune settings with a keep-all option intended to be used as
+ * part of an edit/create window.
+ */
+Ext.define('PVE.panel.BackupJobPrune', {
+    extend: 'Proxmox.panel.PruneInputPanel',
+    xtype: 'pveBackupJobPrunePanel',
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    onlineHelp: 'vzdump_retention',
+
+    onGetValues: function(formValues) {
+       if (this.needMask) { // isMasked() may not yet be true if not rendered once
+           return {};
+       } else if (this.isCreate && !this.rendered) {
+           return this.keepAllDefaultForCreate ? { 'prune-backups': 'keep-all=1' } : {};
+       }
+       delete formValues.delete;
+       let retention = PVE.Parser.printPropertyString(formValues);
+       if (retention === '') {
+           if (this.isCreate) {
+               return {};
+           }
+           // always delete old 'maxfiles' on edit, we map it to keep-last on window load
+           return {
+               'delete': ['prune-backups', 'maxfiles'],
+           };
+       }
+       let options = { 'prune-backups': retention };
+       if (!this.isCreate) {
+           options.delete = 'maxfiles';
+       }
+       return options;
+    },
+
+    updateComponents: function() {
+       let me = this;
+
+       let keepAll = me.down('proxmoxcheckbox[name=keep-all]').getValue();
+       let anyValue = false;
+       me.query('pmxPruneKeepField').forEach(field => {
+           anyValue = anyValue || field.getValue() !== null;
+           field.setDisabled(keepAll);
+       });
+       me.down('component[name=no-keeps-hint]').setHidden(anyValue || keepAll);
+    },
+
+    listeners: {
+       afterrender: function(panel) {
+           if (panel.needMask) {
+               panel.down('component[name=no-keeps-hint]').setHtml('');
+               panel.mask(
+                   gettext('Backup content type not available for this storage.'),
+               );
+           } else if (panel.isCreate && panel.keepAllDefaultForCreate) {
+               panel.down('proxmoxcheckbox[name=keep-all]').setValue(true);
+           }
+           panel.down('component[name=pbs-hint]').setHidden(!panel.showPBSHint);
+
+           panel.query('pmxPruneKeepField').forEach(field => {
+               field.on('change', panel.updateComponents, panel);
+           });
+           panel.updateComponents();
+       },
+    },
+
+    columnT: {
+       xtype: 'proxmoxcheckbox',
+       name: 'keep-all',
+       boxLabel: gettext('Keep all backups'),
+       listeners: {
+           change: function(field, newValue) {
+               let panel = field.up('pveBackupJobPrunePanel');
+               panel.updateComponents();
+           },
+       },
+    },
+
+    columnB: [
+       {
+           xtype: 'component',
+           userCls: 'pmx-hint',
+           name: 'no-keeps-hint',
+           hidden: true,
+           padding: '5 1',
+           cbind: {
+               html: '{fallbackHintHtml}',
+           },
+       },
+       {
+           xtype: 'component',
+           userCls: 'pmx-hint',
+           name: 'pbs-hint',
+           hidden: true,
+           padding: '5 1',
+           html: gettext("It's preferred to configure backup retention directly on the Proxmox Backup Server."),
+       },
+    ],
+});
diff --git a/www/manager6/panel/EditPruneInputPanel.js b/www/manager6/panel/EditPruneInputPanel.js
deleted file mode 100644 (file)
index 547daec..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Input panel for prune settings with a keep-all option intended to be used as
- * part of an edit/create window.
- */
-Ext.define('PVE.panel.EditPruneInputPanel', {
-    extend: 'Proxmox.panel.PruneInputPanel',
-    xtype: 'pveEditPruneInputPanel',
-    mixins: ['Proxmox.Mixin.CBind'],
-
-    onlineHelp: 'vzdump_retention',
-
-    onGetValues: function(formValues) {
-       if (this.needMask) { // isMasked() may not yet be true if not rendered once
-           return {};
-       } else if (this.isCreate && !this.rendered) {
-           return this.keepAllDefaultForCreate ? { 'prune-backups': 'keep-all=1' } : {};
-       }
-       delete formValues.delete;
-       let retention = PVE.Parser.printPropertyString(formValues);
-       if (retention === '') {
-           if (this.isCreate) {
-               return {};
-           }
-           // always delete old 'maxfiles' on edit, we map it to keep-last on window load
-           return {
-               'delete': ['prune-backups', 'maxfiles'],
-           };
-       }
-       let options = { 'prune-backups': retention };
-       if (!this.isCreate) {
-           options.delete = 'maxfiles';
-       }
-       return options;
-    },
-
-    updateComponents: function() {
-       let me = this;
-
-       let keepAll = me.down('proxmoxcheckbox[name=keep-all]').getValue();
-       let anyValue = false;
-       me.query('pmxPruneKeepField').forEach(field => {
-           anyValue = anyValue || field.getValue() !== null;
-           field.setDisabled(keepAll);
-       });
-       me.down('component[name=no-keeps-hint]').setHidden(anyValue || keepAll);
-    },
-
-    listeners: {
-       afterrender: function(panel) {
-           if (panel.needMask) {
-               panel.down('component[name=no-keeps-hint]').setHtml('');
-               panel.mask(
-                   gettext('Backup content type not available for this storage.'),
-               );
-           } else if (panel.isCreate && panel.keepAllDefaultForCreate) {
-               panel.down('proxmoxcheckbox[name=keep-all]').setValue(true);
-           }
-           panel.down('component[name=pbs-hint]').setHidden(!panel.showPBSHint);
-
-           panel.query('pmxPruneKeepField').forEach(field => {
-               field.on('change', panel.updateComponents, panel);
-           });
-           panel.updateComponents();
-       },
-    },
-
-    columnT: {
-       xtype: 'proxmoxcheckbox',
-       name: 'keep-all',
-       boxLabel: gettext('Keep all backups'),
-       listeners: {
-           change: function(field, newValue) {
-               let panel = field.up('pveEditPruneInputPanel');
-               panel.updateComponents();
-           },
-       },
-    },
-
-    columnB: [
-       {
-           xtype: 'component',
-           userCls: 'pmx-hint',
-           name: 'no-keeps-hint',
-           hidden: true,
-           padding: '5 1',
-           cbind: {
-               html: '{fallbackHintHtml}',
-           },
-       },
-       {
-           xtype: 'component',
-           userCls: 'pmx-hint',
-           name: 'pbs-hint',
-           hidden: true,
-           padding: '5 1',
-           html: gettext("It's preferred to configure backup retention directly on the Proxmox Backup Server."),
-       },
-    ],
-});
index ffafc87e3db62430cb502df27c1c9179779ca86c..f339e8cda9125545302ea7beafeff4694aa0112c 100644 (file)
@@ -97,7 +97,7 @@ Ext.define('PVE.storage.BaseEdit', {
                items: [
                    me.ipanel,
                    {
-                       xtype: 'pveEditPruneInputPanel',
+                       xtype: 'pveBackupJobPrunePanel',
                        title: gettext('Backup Retention'),
                        isCreate: me.isCreate,
                        keepAllDefaultForCreate: true,