all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager] ui: guest cmd menu: don't close it when error dialog is clicked
@ 2026-11-02 15:25 Dominik Csapak
  0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2026-11-02 15:25 UTC (permalink / raw)
  To: pve-devel

If for some reason the API call fails (wrongly cached permissions,
invalid storage configuration in the guest, etc.) interacting with the
error popup normally steals focus from the context menu and closes it.

Even in such an 'invalid' configuration state, we should not deny
users access to the cmd menu in this way, so prevent the context menu
from hiding until the error message is closed.

The take snapshot button is disabled by default, so without the result
of the API call it simply does not get enabled.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/lxc/CmdMenu.js  | 8 ++++++++
 www/manager6/qemu/CmdMenu.js | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/www/manager6/lxc/CmdMenu.js b/www/manager6/lxc/CmdMenu.js
index a7940e04..3997f515 100644
--- a/www/manager6/lxc/CmdMenu.js
+++ b/www/manager6/lxc/CmdMenu.js
@@ -185,6 +185,8 @@ Ext.define('PVE.lxc.CmdMenu', {
         me.callParent();
 
         if (caps.vms['VM.Snapshot']) {
+            let errorShown = false;
+            me.on('beforehide', () => !errorShown);
             Proxmox.Utils.API2Request({
                 url: `/nodes/${info.node}/${info.type}/${info.vmid}/feature`,
                 params: { feature: 'snapshot' },
@@ -196,6 +198,12 @@ Ext.define('PVE.lxc.CmdMenu', {
                         btn.setDisabled(!hasFeature);
                     }
                 },
+                failure: (response) => {
+                    errorShown = true;
+                    Ext.Msg.alert(gettext('Error'), response.htmlStatus, () => {
+                        errorShown = false;
+                    });
+                },
             });
         }
     },
diff --git a/www/manager6/qemu/CmdMenu.js b/www/manager6/qemu/CmdMenu.js
index df6045bf..1699881b 100644
--- a/www/manager6/qemu/CmdMenu.js
+++ b/www/manager6/qemu/CmdMenu.js
@@ -230,6 +230,8 @@ Ext.define('PVE.qemu.CmdMenu', {
         me.callParent();
 
         if (caps.vms['VM.Snapshot']) {
+            let errorShown = false;
+            me.on('beforehide', () => !errorShown);
             Proxmox.Utils.API2Request({
                 url: `/nodes/${info.node}/${info.type}/${info.vmid}/feature`,
                 params: { feature: 'snapshot' },
@@ -241,6 +243,12 @@ Ext.define('PVE.qemu.CmdMenu', {
                         btn.setDisabled(!hasFeature);
                     }
                 },
+                failure: (response) => {
+                    errorShown = true;
+                    Ext.Msg.alert(gettext('Error'), response.htmlStatus, () => {
+                        errorShown = false;
+                    });
+                },
             });
         }
     },
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-02 15:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 15:25 [PATCH manager] ui: guest cmd menu: don't close it when error dialog is clicked Dominik Csapak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal