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 F2A1B1FF09C for ; Mon, 02 Nov 2026 16:25:45 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 98CA021AAA; Mon, 02 Nov 2026 16:25:44 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager] ui: guest cmd menu: don't close it when error dialog is clicked Date: Mon, 2 Nov 2026 16:25:32 +0100 Message-ID: <20261102152540.3397919-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.332 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) 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: CRODAGK6CN6467I4IFM6MZ5MGYBPNNZA X-Message-ID-Hash: CRODAGK6CN6467I4IFM6MZ5MGYBPNNZA 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: 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 --- 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