From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6BCB11FF348 for ; Wed, 17 Apr 2024 17:55:13 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 87ECFE072; Wed, 17 Apr 2024 17:55:11 +0200 (CEST) From: Folke Gleumes To: pve-devel@lists.proxmox.com Date: Wed, 17 Apr 2024 17:55:05 +0200 Message-Id: <20240417155505.474423-3-f.gleumes@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240417155505.474423-1-f.gleumes@proxmox.com> References: <20240417155505.474423-1-f.gleumes@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 Subject: [pve-devel] [PATCH manager v2 2/2] webui: acme: add eab fields 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Adds fields for eab credentials. By default eab is optional, but if the directory should report that eab is required, the eab credential fields are marked as mandatory and prevent the form from being submittable until credentials are provided. Signed-off-by: Folke Gleumes --- www/manager6/node/ACME.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js index d2863a7c..a0db51a6 100644 --- a/www/manager6/node/ACME.js +++ b/www/manager6/node/ACME.js @@ -16,6 +16,12 @@ Ext.define('PVE.node.ACMEAccountCreate', { viewModel: { data: { customDirectory: false, + eabRequired: false, + }, + formulas: { + eabEmptyText: function(get) { + return get('eabRequired') ? gettext("required") : gettext("optional"); + }, }, }, @@ -124,6 +130,7 @@ Ext.define('PVE.node.ACMEAccountCreate', { let me = this; let w = me.up('window'); + let vm = w.getViewModel(); let disp = w.down('#tos_url_display'); let field = w.down('#tos_url'); let checkbox = w.down('#tos_checkbox'); @@ -151,6 +158,7 @@ Ext.define('PVE.node.ACMEAccountCreate', { checkbox.setValue(false); disp.setValue("No terms of service agreement required"); } + vm.set('eabRequired', !!response.result.data.externalAccountRequired); }, failure: function(response, opt) { disp.setValue(undefined); @@ -185,6 +193,26 @@ Ext.define('PVE.node.ACMEAccountCreate', { return false; }, }, + { + xtype: 'proxmoxtextfield', + name: 'eab-kid', + fieldLabel: gettext('EAB Key ID'), + bind: { + hidden: '{!customDirectory}', + allowBlank: '{!eabRequired}', + emptyText: '{eabEmptyText}', + }, + }, + { + xtype: 'proxmoxtextfield', + name: 'eab-hmac-key', + fieldLabel: gettext('EAB Key'), + bind: { + hidden: '{!customDirectory}', + allowBlank: '{!eabRequired}', + emptyText: '{eabEmptyText}', + }, + }, ], clearToSFields: function() { -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel