From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 0845F1FF0AF for ; Fri, 20 Nov 2026 10:52:54 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9DFB4216F2; Fri, 20 Nov 2026 10:52:43 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v4 3/3] ui: workspace: show reload notice when UI packages were updated Date: Fri, 20 Nov 2026 10:46:39 +0100 Message-ID: <20261120095235.1143525-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261120095235.1143525-1-d.csapak@proxmox.com> References: <20261120095235.1143525-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.121 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 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: MGEUDYZT5EYWCL2OIBGYDUI4PE6SJS5A X-Message-ID-Hash: MGEUDYZT5EYWCL2OIBGYDUI4PE6SJS5A 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 one reported from /nodes/{node}/version (which is now polled regularly) and show the user a notice in the top bar to reload the UI. Show a short "New version" label with a Reload UI button next to the version string as soon as the change is detected. A tooltip on both says that the new version is installed and the page needs a reload. The notice fits the top bar at 1280 px also with longer translations, and the info icon matches the EOL notice of earlier releases. Re-purpose the `updateVersionInfo` method for this, since that handles the version info already. Co-developed-by: Thomas Lamprecht Signed-off-by: Dominik Csapak --- www/manager6/Workspace.js | 82 +++++++++++++++++++++++++++++++++------ 1 file changed, 71 insertions(+), 11 deletions(-) diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js index 189d3373..b1fe50da 100644 --- a/www/manager6/Workspace.js +++ b/www/manager6/Workspace.js @@ -163,13 +163,23 @@ Ext.define('PVE.StdWorkspace', { if (loginData) { PVE.data.ResourceStore.startUpdate(); - Proxmox.Utils.API2Request({ - url: '/version', - method: 'GET', - success: function (response) { - PVE.VersionInfo = response.result.data; - me.updateVersionInfo(); + me.versionTask ??= Ext.TaskManager.start({ + run: () => { + if (!Proxmox.Utils.authOK()) { + return; + } + Proxmox.Utils.API2Request({ + url: `/nodes/${Proxmox.NodeName}/version`, + method: 'GET', + success: function (response) { + me.updateVersionInfo(response.result.data); + }, + failure: () => { + // Ignore errors + }, + }); }, + interval: 2 * 60 * 1000, }); PVE.UIOptions.update(); @@ -200,18 +210,36 @@ Ext.define('PVE.StdWorkspace', { ui.updateLayout(); }, - updateVersionInfo: function () { + updateVersionInfo: function (versionInfo) { let me = this; let ui = me.query('#versioninfo')[0]; - if (PVE.VersionInfo) { - let version = PVE.VersionInfo.version; - ui.update('Virtual Environment ' + version); - } else { + if (!PVE.VersionInfo && !versionInfo) { ui.update('Virtual Environment'); + ui.updateLayout(); + return; } + + // only update the visible version once + PVE.VersionInfo ??= versionInfo; + + ui.update('Virtual Environment ' + PVE.VersionInfo.version); ui.updateLayout(); + + // compare the versions the backend reports with the ones this page was loaded with + if (!versionInfo?.['ui-version']) { + return; + } + + let notice = me.down('#uiUpdateNotice'); + if (notice.isVisible()) { + return; + } + + if (Proxmox.UIVersion !== versionInfo['ui-version']) { + notice.setVisible(true); + } }, initComponent: function () { @@ -274,6 +302,10 @@ Ext.define('PVE.StdWorkspace', { let caps = appState.get('GuiCap'); + let uiUpdateTip = gettext( + 'A new version of the web interface was installed. Reload the page to use it.', + ); + let createVM = Ext.createWidget('button', { pack: 'end', margin: '3 5 0 0', @@ -352,6 +384,34 @@ Ext.define('PVE.StdWorkspace', { 'line-height': '20px', }, }, + { + xtype: 'container', + itemId: 'uiUpdateNotice', + hidden: true, + layout: { + type: 'hbox', + align: 'middle', + }, + margin: '0 5', + items: [ + { + xtype: 'component', + autoEl: { + tag: 'div', + 'data-qtip': uiUpdateTip, + }, + html: ` ${gettext('New version')}`, + margin: '0 5 0 0', + }, + { + xtype: 'button', + cls: 'x-btn-default-toolbar-small proxmox-inline-button', + text: gettext('Reload UI'), + tooltip: uiUpdateTip, + handler: () => window.location.reload(), + }, + ], + }, { flex: 2, }, -- 2.47.3