[pve-devel] [PATCH widget-toolkit 3/5] webhook edit: use type in add button text

Dominik Csapak d.csapak at proxmox.com
Tue Nov 12 15:41:54 CET 2024


so one can more easily see what gets added.

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/panel/WebhookEditPanel.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/panel/WebhookEditPanel.js b/src/panel/WebhookEditPanel.js
index fcc5b06..8b76d0a 100644
--- a/src/panel/WebhookEditPanel.js
+++ b/src/panel/WebhookEditPanel.js
@@ -70,6 +70,7 @@ Ext.define('Proxmox.panel.WebhookEditPanel', {
 	    xtype: 'pmxWebhookKeyValueList',
 	    name: 'header',
 	    fieldLabel: gettext('Headers'),
+	    subject: gettext('Header'),
 	    maskValues: false,
 	    cbind: {
 		isCreate: '{isCreate}',
@@ -91,6 +92,7 @@ Ext.define('Proxmox.panel.WebhookEditPanel', {
 	    xtype: 'pmxWebhookKeyValueList',
 	    name: 'secret',
 	    fieldLabel: gettext('Secrets'),
+	    subject: gettext('Secret'),
 	    maskValues: true,
 	    cbind: {
 		isCreate: '{isCreate}',
@@ -168,6 +170,9 @@ Ext.define('Proxmox.form.WebhookKeyValueList', {
     // override for column header
     fieldTitle: gettext('Item'),
 
+    // the text for a single element, used for the add button
+    subject: undefined,
+
     // will be applied to the textfields
     maskRe: undefined,
 
@@ -391,7 +396,7 @@ Ext.define('Proxmox.form.WebhookKeyValueList', {
 	    },
 	    {
 		xtype: 'button',
-		text: gettext('Add'),
+		text: me.subject ? Ext.String.format(gettext('Add {0}'), me.subject) : gettext('Add'),
 		iconCls: 'fa fa-plus-circle',
 		handler: 'addLine',
 	    },
-- 
2.39.5





More information about the pve-devel mailing list