[pve-devel] applied-partial-series: [PATCH v2 manager 1/3] ui: mpedit: activate backup on MP creation

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Dec 9 15:15:43 CET 2019


On 12/2/19 10:58 AM, Aaron Lauterer wrote:
> 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 at proxmox.com>
> ---
>  www/manager6/lxc/MPEdit.js | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/lxc/MPEdit.js b/www/manager6/lxc/MPEdit.js
> index 780bef0f..9f84bcc2 100644
> --- a/www/manager6/lxc/MPEdit.js
> +++ b/www/manager6/lxc/MPEdit.js
> @@ -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}'
>  	    }
>  	}
>      ],
> 

thanks, applied 1/2 and 3/3, and followed up with a patch changing the name
back to "Backup" and adding a tool-tip, as I was looking at the result that
seemed like the best trade-off. Giving users wondering about the checkbox a
way to get a better, more detailed, explanation, but without adding to much
text to the UI:

----8<----
diff --git a/www/manager6/lxc/MPEdit.js b/www/manager6/lxc/MPEdit.js
index 9f84bcc2..e52a9b22 100644
--- a/www/manager6/lxc/MPEdit.js
+++ b/www/manager6/lxc/MPEdit.js
@@ -245,7 +245,11 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
        {
            xtype: 'proxmoxcheckbox',
            name: 'backup',
-           fieldLabel: gettext('Include in backup'),
+           fieldLabel: gettext('Backup'),
+           autoEl: {
+               tag: 'div',
+               'data-qtip': gettext('Include volume in backup job'),
+           },
            bind: {
                hidden: '{isRoot}',
                disabled: '{isBindOrRoot}',
diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index fa2fea9e..8d469f6f 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -291,7 +291,11 @@ Ext.define('PVE.qemu.HDInputPanel', {
        me.advancedColumn2.push(
            {
                xtype: 'proxmoxcheckbox',
-               fieldLabel: gettext('Include in backup'),
+               fieldLabel: gettext('Backup'),
+               autoEl: {
+                   tag: 'div',
+                   'data-qtip': gettext('Include volume in backup job'),
+               },
                uncheckedValue: 'no',
                labelWidth: labelWidth,
                name: 'backup',
---




More information about the pve-devel mailing list