public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Michal Fox <me@dualfroz.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH manager] fix #5608: ui: resource mappings: validate the name like the API does
Date: Tue, 29 Sep 2026 16:13:13 +0200	[thread overview]
Message-ID: <20260929141313.2873638-1-me@dualfroz.com> (raw)

The API only accepts resource mapping IDs in the 'pve-configid' format,
but the name field of the PCI, USB and directory mapping windows takes
any value. A name like 'gpu@node1' is thus only rejected after
submitting, with a generic "invalid configuration ID" error that does
not tell which characters are allowed.

Use the existing 'ConfigId' vtype, so the field is marked invalid right
away and its tooltip lists the allowed characters.

Signed-off-by: Michal Fox <me@dualfroz.com>
---
 www/manager6/window/DirMapEdit.js | 1 +
 www/manager6/window/PCIMapEdit.js | 1 +
 www/manager6/window/USBMapEdit.js | 1 +
 3 files changed, 3 insertions(+)

diff --git a/www/manager6/window/DirMapEdit.js b/www/manager6/window/DirMapEdit.js
index 841ff1fe..bc6a7d03 100644
--- a/www/manager6/window/DirMapEdit.js
+++ b/www/manager6/window/DirMapEdit.js
@@ -142,6 +142,7 @@ Ext.define('PVE.window.DirMapEditWindow', {
                     },
                     name: 'name',
                     allowBlank: false,
+                    vtype: 'ConfigId',
                 },
                 {
                     xtype: 'pveNodeSelector',
diff --git a/www/manager6/window/PCIMapEdit.js b/www/manager6/window/PCIMapEdit.js
index 625f4ad4..28aa4772 100644
--- a/www/manager6/window/PCIMapEdit.js
+++ b/www/manager6/window/PCIMapEdit.js
@@ -217,6 +217,7 @@ Ext.define('PVE.window.PCIMapEditWindow', {
                     },
                     name: 'id',
                     allowBlank: false,
+                    vtype: 'ConfigId',
                 },
                 {
                     xtype: 'displayfield',
diff --git a/www/manager6/window/USBMapEdit.js b/www/manager6/window/USBMapEdit.js
index 5c90ea3b..ba5e2c60 100644
--- a/www/manager6/window/USBMapEdit.js
+++ b/www/manager6/window/USBMapEdit.js
@@ -153,6 +153,7 @@ Ext.define('PVE.window.USBMapEditWindow', {
                     },
                     name: 'name',
                     allowBlank: false,
+                    vtype: 'ConfigId',
                 },
                 {
                     xtype: 'displayfield',
-- 
2.43.0




             reply	other threads:[~2026-09-30  7:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 14:13 Michal Fox [this message]
2026-09-30 10:27 ` applied: [PATCH manager] fix #5608: ui: resource mappings: validate the name like the API does 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=20260929141313.2873638-1-me@dualfroz.com \
    --to=me@dualfroz.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal