From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path: <f.ebner@proxmox.com>
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))
(No client certificate requested)
by lists.proxmox.com (Postfix) with ESMTPS id B55CA70A89
for <pve-devel@lists.proxmox.com>; Mon, 9 May 2022 12:34:48 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
by firstgate.proxmox.com (Proxmox) with ESMTP id 9D8FA2B6AE
for <pve-devel@lists.proxmox.com>; Mon, 9 May 2022 12:34:18 +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))
(No client certificate requested)
by firstgate.proxmox.com (Proxmox) with ESMTPS id 3636B2B67F
for <pve-devel@lists.proxmox.com>; Mon, 9 May 2022 12:34:17 +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 0BD3A4323B
for <pve-devel@lists.proxmox.com>; Mon, 9 May 2022 12:34:17 +0200 (CEST)
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Mon, 9 May 2022 12:34:10 +0200
Message-Id: <20220509103413.68248-4-f.ebner@proxmox.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20220509103413.68248-1-f.ebner@proxmox.com>
References: <20220509103413.68248-1-f.ebner@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results: 0
AWL 0.078 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 v2 manager 3/6] 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 <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>,
<mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>,
<mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 09 May 2022 10:34:48 -0000
rather than as a tooltip.
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
Re-sent v1.
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', {
+ '<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(', '),
),
},
],
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 => `<code>{{${v}}}</code>`).join(', '),
+ ),
},
{
xtype: 'label',
--
2.30.2