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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 349846A085 for ; Fri, 12 Mar 2021 16:25:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 76657347C9 for ; Fri, 12 Mar 2021 16:24:31 +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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id BCA1734746 for ; Fri, 12 Mar 2021 16:24:27 +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 81C91463F9 for ; Fri, 12 Mar 2021 16:24:27 +0100 (CET) From: Wolfgang Bumiller To: pmg-devel@lists.proxmox.com Date: Fri, 12 Mar 2021 16:24:06 +0100 Message-Id: <20210312152421.30114-18-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312152421.30114-1-w.bumiller@proxmox.com> References: <20210312152421.30114-1-w.bumiller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.036 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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: [pmg-devel] [PATCH v2 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: Fri, 12 Mar 2021 15:25:07 -0000 Signed-off-by: Wolfgang Bumiller --- Changes to v1: * removed superfluous `border: 0` * removed initComponent and commented-out help reference (to be filled by the user atm) js/Certificates.js | 96 ++++++++++++++++++++++++++++++++++++++++++++ js/Makefile | 1 + js/NavigationTree.js | 6 +++ 3 files changed, 103 insertions(+) create mode 100644 js/Certificates.js diff --git a/js/Certificates.js b/js/Certificates.js new file mode 100644 index 0000000..a2c25a5 --- /dev/null +++ b/js/Certificates.js @@ -0,0 +1,96 @@ +Ext.define('PMG.CertificateConfiguration', { + extend: 'Ext.tab.Panel', + alias: 'widget.pmgCertificateConfiguration', + + title: gettext('Certificates'), + + border: false, + defaults: { border: false }, + + items: [ + { + itemId: 'certificates', + xtype: 'pmgCertificatesView', + }, + { + itemId: 'acme', + xtype: 'pmgACMEConfigView', + }, + ], +}); + +Ext.define('PMG.CertificateView', { + extend: 'Ext.container.Container', + alias: 'widget.pmgCertificatesView', + + title: gettext('Certificates'), + + 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`, + }, + ], + }, + ], +}); + +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, + }, ], }, { -- 2.20.1