* [pve-devel] [PATCH manager] fix #4663: Prevent Web UI reload on cert order for other node
@ 2023-08-16 8:25 Filip Schauer
2023-08-16 9:45 ` Dominik Csapak
0 siblings, 1 reply; 2+ messages in thread
From: Filip Schauer @ 2023-08-16 8:25 UTC (permalink / raw)
To: pve-devel
While it makes sense to reload the Web UI after ordering a certificate
for the same node, it is unnecessary to reload the Web UI when ordering
a certificate for a different node.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
This change has been tested by ordering a valid Let's Encrypt
certificate for another node. This was done by temporarily exposing port
80 of the node through a Cloudflare Tunnel. The results indicated that
there was no need to reload the current panel.
www/manager6/node/ACME.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js
index 0642e7c5..122487c1 100644
--- a/www/manager6/node/ACME.js
+++ b/www/manager6/node/ACME.js
@@ -523,6 +523,8 @@ Ext.define('PVE.node.ACME', {
orderFinished: function(success) {
if (!success) return;
+ // reload only if the Web UI is open on the same node that the cert was ordered for
+ if (this.getView().nodename !== Proxmox.NodeName) return;
var txt = gettext('pveproxy will be restarted with new certificates, please reload the GUI!');
Ext.getBody().mask(txt, ['pve-static-mask']);
// reload after 10 seconds automatically
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pve-devel] [PATCH manager] fix #4663: Prevent Web UI reload on cert order for other node
2023-08-16 8:25 [pve-devel] [PATCH manager] fix #4663: Prevent Web UI reload on cert order for other node Filip Schauer
@ 2023-08-16 9:45 ` Dominik Csapak
0 siblings, 0 replies; 2+ messages in thread
From: Dominik Csapak @ 2023-08-16 9:45 UTC (permalink / raw)
To: Proxmox VE development discussion, Filip Schauer
semantically the patch looks good to me, but please check our style guide:
https://pve.proxmox.com/wiki/Javascript_Style_Guide
i know that the surrounding code isn't correctly formatted that way, but
for new code please don't use single line if statements
On 8/16/23 10:25, Filip Schauer wrote:
> While it makes sense to reload the Web UI after ordering a certificate
> for the same node, it is unnecessary to reload the Web UI when ordering
> a certificate for a different node.
>
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
> ---
> This change has been tested by ordering a valid Let's Encrypt
> certificate for another node. This was done by temporarily exposing port
> 80 of the node through a Cloudflare Tunnel. The results indicated that
> there was no need to reload the current panel.
>
> www/manager6/node/ACME.js | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/www/manager6/node/ACME.js b/www/manager6/node/ACME.js
> index 0642e7c5..122487c1 100644
> --- a/www/manager6/node/ACME.js
> +++ b/www/manager6/node/ACME.js
> @@ -523,6 +523,8 @@ Ext.define('PVE.node.ACME', {
>
> orderFinished: function(success) {
> if (!success) return;
> + // reload only if the Web UI is open on the same node that the cert was ordered for
> + if (this.getView().nodename !== Proxmox.NodeName) return;
> var txt = gettext('pveproxy will be restarted with new certificates, please reload the GUI!');
> Ext.getBody().mask(txt, ['pve-static-mask']);
> // reload after 10 seconds automatically
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-16 9:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16 8:25 [pve-devel] [PATCH manager] fix #4663: Prevent Web UI reload on cert order for other node Filip Schauer
2023-08-16 9:45 ` Dominik Csapak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox