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 3D0A169808 for ; Thu, 11 Mar 2021 13:35:44 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 25CD82851F for ; Thu, 11 Mar 2021 13:35:14 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 DF93B2850F for ; Thu, 11 Mar 2021 13:35:12 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id ACC6446280 for ; Thu, 11 Mar 2021 13:35:12 +0100 (CET) To: pmg-devel@lists.proxmox.com References: <20210309141401.19237-1-w.bumiller@proxmox.com> <20210309141401.19237-10-w.bumiller@proxmox.com> From: Dominik Csapak Message-ID: <754b8114-110d-a7ee-e3a3-6ebf73c04f9b@proxmox.com> Date: Thu, 11 Mar 2021 13:35:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210309141401.19237-10-w.bumiller@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.191 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pmg-devel] [PATCH gui] add certificates and acme view X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2021 12:35:44 -0000 comments inline On 3/9/21 3:13 PM, Wolfgang Bumiller wrote: > Signed-off-by: Wolfgang Bumiller > --- > js/Certificates.js | 108 +++++++++++++++++++++++++++++++++++++++++++ > js/Makefile | 1 + > js/NavigationTree.js | 6 +++ > 3 files changed, 115 insertions(+) > create mode 100644 js/Certificates.js > > diff --git a/js/Certificates.js b/js/Certificates.js > new file mode 100644 > index 0000000..33b1bde > --- /dev/null > +++ b/js/Certificates.js > @@ -0,0 +1,108 @@ > +Ext.define('PMG.CertificateConfiguration', { > + extend: 'Ext.tab.Panel', > + alias: 'widget.pmgCertificateConfiguration', > + > + title: gettext('Certificates'), > + > + border: false, > + defaults: { border: false }, > + > + items: [ > + { > + itemId: 'certificates', > + xtype: 'pmgCertificatesView', > + border: 0, > + }, > + { > + itemId: 'acme', > + xtype: 'pmgACMEConfigView', > + border: 0, > + }, > + ], > +}); why the defaults: border: false and the border: 0? one should be enough > + > +Ext.define('PMG.CertificateView', { > + extend: 'Ext.container.Container', > + alias: 'widget.pmgCertificatesView', > + > + title: gettext('Certificates'), > + > + //onlineHelp: 'sysadmin_certificate_management', seems to be leftover (we should probably have the docs here too?) > + > + initComponent: function() { > + let me = this; > + > + Ext.apply(me, { > + items: [ > + { > + xtype: 'pmxCertificates', > + border: 0, > + infoUrl: '/nodes/' + Proxmox.NodeName + '/certificates/info', > + uploadButtons: [ > + { > + name: 'API', > + id: 'pmg-api.pem', > + url: `/nodes/${Proxmox.NodeName}/certificates/custom/api`, > + deletable: false, > + reloadUi: true, > + }, > + { > + name: 'SMTP', > + id: 'pmg-tls.pem', > + url: `/nodes/${Proxmox.NodeName}/certificates/custom/smtp`, > + deletable: true, > + }, > + ], > + }, > + { > + xtype: 'pmxACMEDomains', > + border: 0, > + url: `/nodes/${Proxmox.NodeName}/config`, > + nodename: Proxmox.NodeName, > + acmeUrl: '/config/acme', > + domainUsages: [ > + { > + usage: 'api', > + name: 'API', > + url: `/nodes/${Proxmox.NodeName}/certificates/acme/api`, > + reloadUi: true, > + }, > + { > + usage: 'smtp', > + name: 'SMTP', > + url: `/nodes/${Proxmox.NodeName}/certificates/acme/smtp`, > + }, > + ], > + }, > + ], > + }); > + > + me.callParent(); > + }, > +}); this could be written without initComponent, nothing there depends on a local variable (Proxmox.NodeName is set by the page and always available) > + > +Ext.define('PMG.ACMEConfigView', { > + extend: 'Ext.panel.Panel', > + alias: 'widget.pmgACMEConfigView', > + > + title: gettext('ACME Accounts'), > + > + //onlineHelp: 'sysadmin_certificate_management', > + > + items: [ > + { > + region: 'north', > + border: false, > + xtype: 'pmxACMEAccounts', > + acmeUrl: '/config/acme', > + }, > + { > + region: 'center', > + border: false, > + xtype: 'pmxACMEPluginView', > + acmeUrl: '/config/acme', > + }, > + ], > +}); > + > + > diff --git a/js/Makefile b/js/Makefile > index a5266fc..43d3ad8 100644 > --- a/js/Makefile > +++ b/js/Makefile > @@ -91,6 +91,7 @@ JSSRC= \ > ContactStatistics.js \ > HourlyMailDistribution.js \ > SpamContextMenu.js \ > + Certificates.js \ > Application.js > > OnlineHelpInfo.js: /usr/bin/asciidoc-pmg > diff --git a/js/NavigationTree.js b/js/NavigationTree.js > index ac01fd6..63f8e94 100644 > --- a/js/NavigationTree.js > +++ b/js/NavigationTree.js > @@ -92,6 +92,12 @@ Ext.define('PMG.store.NavigationStore', { > path: 'pmgBackupConfiguration', > leaf: true, > }, > + { > + text: gettext('Certificates'), > + iconCls: 'fa fa-certificate', > + path: 'pmgCertificateConfiguration', > + leaf: true, > + }, > ], > }, > { >