public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH V2 pve-manager 1/2] fix #1981: get next free disk id on change of bus/device
Date: Mon, 10 Oct 2022 17:21:15 +0200	[thread overview]
Message-ID: <20221010152116.1928727-2-s.hrdlicka@proxmox.com> (raw)
In-Reply-To: <20221010152116.1928727-1-s.hrdlicka@proxmox.com>

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
---
 FYI: When IDE already has 4 devices and the user tries to add another one,
 the number device number isn't changed since there isn't any space
 left.

 www/manager6/form/ControllerSelector.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index d84c49d6..8a52737d 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -12,7 +12,7 @@ Ext.define('PVE.form.ControllerSelector', {
 	let freeId = PVE.Utils.nextFreeDisk(controllers, me.vmconfig);
 
 	if (freeId !== undefined) {
-	    busField.setValue(freeId.controller);
+	    busField?.setValue(freeId.controller);
 	    deviceIDField.setValue(freeId.id);
 	}
     },
@@ -83,6 +83,7 @@ Ext.define('PVE.form.ControllerSelector', {
 				return;
 			    }
 			    let field = me.down('field[name=deviceid]');
+			    me.setToFree([value], undefined, field);
 			    field.setMaxValue(PVE.Utils.diskControllerMaxIDs[value] - 1);
 			    field.validate();
 			},
-- 
2.30.2





  reply	other threads:[~2022-10-10 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 15:21 [pve-devel] [PATCH V2 pve-manager 0/2] " Stefan Hrdlicka
2022-10-10 15:21 ` Stefan Hrdlicka [this message]
2022-10-10 15:21 ` [pve-devel] [PATCH V2 pve-manager 2/2] cleanup: style fix Stefan Hrdlicka
2022-10-24 11:47 ` [pve-devel] applied: [PATCH V2 pve-manager 0/2] fix #1981: get next free disk id on change of bus/device 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=20221010152116.1928727-2-s.hrdlicka@proxmox.com \
    --to=s.hrdlicka@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal