From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 22A0A1FF0AB for ; Wed, 23 Sep 2026 13:38:13 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D4446214CA; Wed, 23 Sep 2026 13:38:12 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager 3/3] ui: workspace: prompt user for reload when UI packages were updated Date: Wed, 23 Sep 2026 13:35:03 +0200 Message-ID: <20260923113757.2202858-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260923113757.2202858-1-d.csapak@proxmox.com> References: <20260923113757.2202858-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.244 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far 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 Message-ID-Hash: J6CP57TQB6X5KMXRPODH6Y4GYQRIQIPT X-Message-ID-Hash: J6CP57TQB6X5KMXRPODH6Y4GYQRIQIPT X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When the UI packages (pve-manager, proxmox-widget-toolkit) are updated, an already running Web UI instance still uses the potentially older versions. Detect that by comparing the version from the site load to the ones reported from /cluster/resources (which is polled regularly) and prompt the user to reload the UI. The message box offers a 'Later' option so that ongoing work can be finished before reloading. In that case the notice is shown in the top bar until the user reloads. Signed-off-by: Dominik Csapak --- www/manager6/Workspace.js | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js index 189d3373..392d9783 100644 --- a/www/manager6/Workspace.js +++ b/www/manager6/Workspace.js @@ -193,6 +193,55 @@ Ext.define('PVE.StdWorkspace', { } }, + // compare the versions the backend reports with the ones this page was loaded with + checkGUIVersions: function () { + let me = this; + + if (me.guiUpdateDetected) { + return; + } + + let node = PVE.data.ResourceStore.getNodeById(Proxmox.NodeName); + let versions = node?.data?.versions; + if (!versions) { + return; // e.g., older backend + } + + let changed = Object.entries(Proxmox.GUIVersions ?? {}).some( + ([pkg, loaded]) => versions[pkg] !== undefined && versions[pkg] !== loaded, + ); + if (!changed) { + return; + } + + me.guiUpdateDetected = true; + let msgBox = Ext.create('Ext.window.MessageBox', { + closeAction: 'destroy', + }); + msgBox.show({ + title: gettext('New Version Available'), + message: gettext( + 'A new version of the web interface is available. Reload the page to use it.', + ), + icon: Ext.Msg.INFO, + closable: false, + buttons: Ext.Msg.YESNO, + buttonText: { + yes: gettext('Reload UI'), + no: gettext('Later'), + }, + fn: function (btn) { + if (btn === 'yes') { + window.location.reload(); + } else if (btn === 'no') { + me.down('#uiUpdateHint').setVisible(true); + me.down('#uiUpdateBtn').setVisible(true); + msgBox.close(); + } + }, + }); + }, + updateUserInfo: function () { let me = this; let ui = me.query('#userinfo')[0]; @@ -352,6 +401,21 @@ Ext.define('PVE.StdWorkspace', { 'line-height': '20px', }, }, + { + itemId: 'uiUpdateHint', + html: gettext('A new version of the web interface is available.'), + hidden: true, + }, + { + xtype: 'button', + itemId: 'uiUpdateBtn', + baseCls: 'x-btn', + iconCls: 'fa fa-refresh', + text: gettext('Reload UI'), + margin: '0 5', + hidden: true, + handler: () => window.location.reload(), + }, { flex: 2, }, @@ -546,6 +610,8 @@ Ext.define('PVE.StdWorkspace', { me.updateUserInfo(); + me.mon(PVE.data.ResourceStore, 'load', me.checkGUIVersions, me); + // on resize, center all modal windows Ext.on('resize', function () { let modalWindows = Ext.ComponentQuery.query('window[modal]'); -- 2.47.3