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 8057E68B36 for ; Tue, 9 Mar 2021 15:14:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CE116B1A8 for ; Tue, 9 Mar 2021 15:14:16 +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 51736B0DF for ; Tue, 9 Mar 2021 15:14:09 +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 1C94A462CC for ; Tue, 9 Mar 2021 15:14:09 +0100 (CET) From: Wolfgang Bumiller To: pmg-devel@lists.proxmox.com Date: Tue, 9 Mar 2021 15:13:53 +0100 Message-Id: <20210309141401.19237-10-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210309141401.19237-1-w.bumiller@proxmox.com> References: <20210309141401.19237-1-w.bumiller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.041 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 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: Tue, 09 Mar 2021 14:14:48 -0000 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, + }, + ], +}); + +Ext.define('PMG.CertificateView', { + extend: 'Ext.container.Container', + alias: 'widget.pmgCertificatesView', + + title: gettext('Certificates'), + + //onlineHelp: 'sysadmin_certificate_management', + + 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(); + }, +}); + +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