From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager v2 3/3] ui: workspace: prompt user for reload when UI packages were updated
Date: Thu, 19 Nov 2026 16:38:04 +0100 [thread overview]
Message-ID: <20261119153935.3989613-4-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261119153935.3989613-1-d.csapak@proxmox.com>
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. Note that the prompt could lag behind one
poll cycle, since the node cache gets cleared in 'beforeload' but can be
filled in again by various parts of the UI before the load event (and
thus the check) triggers. This is harmless though, since the next load
will trigger the check with the updated version.
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 <d.csapak@proxmox.com>
---
www/manager6/Workspace.js | 67 +++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
index 189d3373..3bf8a782 100644
--- a/www/manager6/Workspace.js
+++ b/www/manager6/Workspace.js
@@ -193,6 +193,56 @@ 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'),
+ },
+ defaultFocus: 'invalid', // force the focus to be not any button
+ 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 +402,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 +611,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
next prev parent reply other threads:[~2026-11-19 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 15:38 [PATCH pve-manager v2 0/3] ui: prompt users for reload when web ui version changes Dominik Csapak
2026-11-19 15:38 ` [PATCH pve-manager v2 1/3] api: factor out read_pwt_version and pwt_base_dir Dominik Csapak
2026-11-19 15:38 ` [PATCH pve-manager v2 2/3] api: provide GUI versions via index and /cluster/resources Dominik Csapak
2026-11-19 15:38 ` Dominik Csapak [this message]
2026-11-19 17:13 ` superseded: [PATCH pve-manager v2 0/3] ui: prompt users for reload when web ui version changes Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261119153935.3989613-4-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox