]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
ui: mpedit: activate backup on MP creation
authorAaron Lauterer <a.lauterer@proxmox.com>
Mon, 2 Dec 2019 09:58:26 +0000 (10:58 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 9 Dec 2019 13:31:45 +0000 (14:31 +0100)
This patch enables the backup checkbox by default for newly created
LXC mount points.

Hopefully this will help to avoid situations in the future where people
realize too late that the mount point has not been backed up when they
expected it to because they missed the checkbox.

The reason why `view.isCreate` is not passed directly is because
AFAIU the 'view.isCreate' can have one of three values:
* null - editing an existing mount point
* true - creating a new mp
* array('unusedX') - adding an unused disk again

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
www/manager6/lxc/MPEdit.js

index 780bef0f17fd250f027ba2e146587a69129cbf66..9f84bcc2fcf77b6c9975afdb6cdc7f804c936f71 100644 (file)
@@ -134,6 +134,11 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
            vm.set('node', view.nodename);
            vm.set('unpriv', view.unprivileged);
            vm.set('hideStorSelector', view.unused || !view.isCreate);
+
+           // can be array if created from unused disk
+           if (view.isCreate) {
+               vm.set('isIncludedInBackup', true);
+           }
        }
     },
 
@@ -240,10 +245,11 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
        {
            xtype: 'proxmoxcheckbox',
            name: 'backup',
-           fieldLabel: gettext('Backup'),
+           fieldLabel: gettext('Include in backup'),
            bind: {
                hidden: '{isRoot}',
-               disabled: '{isBindOrRoot}'
+               disabled: '{isBindOrRoot}',
+               value: '{isIncludedInBackup}'
            }
        }
     ],