]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: manual backup: list possible template variables directly
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 9 May 2022 10:34:10 +0000 (12:34 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 12 May 2022 15:17:56 +0000 (17:17 +0200)
rather than as a tooltip.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
www/manager6/Utils.js
www/manager6/dc/Backup.js
www/manager6/window/Backup.js

index 8276e95ce5b3e5ef3372bbb6d91863905d48526a..7ca6a271bfe1a1e66b653da4d5770db7ca1f69e8 100644 (file)
@@ -1801,6 +1801,8 @@ Ext.define('PVE.Utils', {
        };
        return value.replace(/(\\\\|\\n)/g, match => replace[match]);
     },
+
+    notesTemplateVars: ['cluster', 'guestname', 'node', 'vmid'],
 },
 
     singleton: true,
index b081be8c8d1e3eb193fc6b5aecbc71d5d927280d..3494aa54c4b9ebe8c5a60c6399e0b8824e56e7ea 100644 (file)
@@ -411,7 +411,7 @@ Ext.define('PVE.dc.BackupEdit', {
                                      + '<br>'
                                      + Ext.String.format(
                                        gettext('Possible template variables are: {0}'),
-                                       ['cluster', 'guestname', 'node', 'vmid'].map(v => `<code>{{${v}}}</code>`).join(', '),
+                                       PVE.Utils.notesTemplateVars.map(v => `<code>{{${v}}}</code>`).join(', '),
                                    ),
                                },
                            ],
index f77e9ffae0e37fe8e7c006073135696aef3a64d4..f768aee3ed672dcdd25c63f2958c056deaaf1a1d 100644 (file)
@@ -181,13 +181,17 @@ Ext.define('PVE.window.Backup', {
                    fieldLabel: gettext('Notes'),
                    anchor: '100%',
                    value: '{{guestname}}',
-                   autoEl: {
-                       tag: 'div',
-                       'data-qtip': Ext.String.format(
-                           gettext('Notes added to the backup. Possible variables are {0}'),
-                           '{{cluster}}, {{guestname}}, {{node}}, {{vmid}}',
-                       ),
+               },
+               {
+                   xtype: 'box',
+                   style: {
+                       margin: '8px 0px',
+                       'line-height': '1.5em',
                    },
+                   html: Ext.String.format(
+                       gettext('Possible template variables are: {0}'),
+                       PVE.Utils.notesTemplateVars.map(v => `<code>{{${v}}}</code>`).join(', '),
+                   ),
                },
                {
                    xtype: 'label',