From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1AE00703C1 for ; Fri, 6 May 2022 09:00:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0F9269772 for ; Fri, 6 May 2022 09:00:54 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id D2F8E9766 for ; Fri, 6 May 2022 09:00:52 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7820E42B75 for ; Fri, 6 May 2022 09:00:52 +0200 (CEST) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Fri, 6 May 2022 09:00:48 +0200 Message-Id: <20220506070048.10342-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.083 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH manager] ui: manual backup: list possible template variables directly X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 07:00:54 -0000 rather than as a tooltip. Suggested-by: Thomas Lamprecht Signed-off-by: Fabian Ebner --- www/manager6/Utils.js | 2 ++ www/manager6/dc/Backup.js | 2 +- www/manager6/window/Backup.js | 16 ++++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index b4e2df79..20e9182e 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -1801,6 +1801,8 @@ Ext.define('PVE.Utils', { }; return value.replace(/(\\\\|\\n)/g, match => replace[match]); }, + + notesTemplateVars: ['cluster', 'guestname', 'node', 'vmid'], }, singleton: true, diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js index b081be8c..3494aa54 100644 --- a/www/manager6/dc/Backup.js +++ b/www/manager6/dc/Backup.js @@ -411,7 +411,7 @@ Ext.define('PVE.dc.BackupEdit', { + '
' + Ext.String.format( gettext('Possible template variables are: {0}'), - ['cluster', 'guestname', 'node', 'vmid'].map(v => `{{${v}}}`).join(', '), + PVE.Utils.notesTemplateVars.map(v => `{{${v}}}`).join(', '), ), }, ], diff --git a/www/manager6/window/Backup.js b/www/manager6/window/Backup.js index f77e9ffa..f768aee3 100644 --- a/www/manager6/window/Backup.js +++ b/www/manager6/window/Backup.js @@ -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 => `{{${v}}}`).join(', '), + ), }, { xtype: 'label', -- 2.30.2