[pve-devel] [PATCH manager 02/10] ui: form/ControllerSelector: set correct max value for the device-id

Dominik Csapak d.csapak at proxmox.com
Mon Sep 20 14:23:30 CEST 2021


the 'diskControllerMaxIDs' object in Utils does not describe the
'maximum ids', but the maximum *number* of ids, so the max is one less

correctly set that instead

the api rejected those values (e.g. ide4) already, so its only a ui change

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/form/ControllerSelector.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index daca2432..27c06169 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -95,7 +95,7 @@ Ext.define('PVE.form.ControllerSelector', {
 				return;
 			    }
 			    let field = me.down('field[name=deviceid]');
-			    field.setMaxValue(PVE.Utils.diskControllerMaxIDs[value]);
+			    field.setMaxValue(PVE.Utils.diskControllerMaxIDs[value] - 1);
 			    field.validate();
 			},
 		    },
@@ -104,7 +104,7 @@ Ext.define('PVE.form.ControllerSelector', {
 		    xtype: 'proxmoxintegerfield',
 		    name: 'deviceid',
 		    minValue: 0,
-		    maxValue: PVE.Utils.diskControllerMaxIDs.ide,
+		    maxValue: PVE.Utils.diskControllerMaxIDs.ide - 1,
 		    value: '0',
 		    flex: 1,
 		    allowBlank: false,
-- 
2.30.2






More information about the pve-devel mailing list