From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2AAB21FF17A for ; Fri, 18 Jul 2025 13:20:59 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 28E641BD6A; Fri, 18 Jul 2025 13:22:04 +0200 (CEST) From: Shan Shaji To: pve-devel@lists.proxmox.com Date: Fri, 18 Jul 2025 13:21:21 +0200 Message-Id: <20250718112121.137040-1-s.shaji@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1752837687662 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.239 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH pve_flutter_frontend] fix: spice: replace wrong error message when the VMs or CTs are off X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" When trying to open the SPICE app from a guest if the guest is not running, the error message shown was "Ensure you have VM.Console Permission". However in the API response the `message` property was returning guest not running message Fix the issue by using the `message` property to show the error message. When checking the same behaviour on web UI the error message shown matches the string from `message` property. Signed-off-by: Shan Shaji --- Tested Scenerio 1: - Created a custom role without the Sys.Console and VM.Console permissions. - Tried opening the SPICE Console and the error message shown is "Permission check failed (/vms/101, VM.Console)" Tested Scenerio 2: - Tried opening the spice file without turning on the guest - The error message shown is "CT 101 not running (500)" lib/widgets/pve_console_menu_widget.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/widgets/pve_console_menu_widget.dart b/lib/widgets/pve_console_menu_widget.dart index cd8c314..cbf4f92 100644 --- a/lib/widgets/pve_console_menu_widget.dart +++ b/lib/widgets/pve_console_menu_widget.dart @@ -61,9 +61,17 @@ class PveConsoleMenu extends StatelessWidget { final response = await apiClient.postRequest(apiPath); final data = json.decode(response.body)['data']; if (data == null) { + String errorDescription = + 'Ensure you have "${type == 'node' ? 'Sys' : 'VM'}.Console" permissions.'; + final message = json.decode(response.body)['message']; + + if (message != null) errorDescription = message; if (context.mounted) { - showTextDialog(context, 'Empty reply from SPICE API', - 'Ensure you have "${type == 'node' ? 'Sys' : 'VM'}.Console" permissions.'); + showTextDialog( + context, + 'Empty reply from SPICE API', + errorDescription, + ); } return; } -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel