public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pve-manager] Web UI: VM creation Wizard: Pupulate EFI and TPM storage by default
@ 2026-08-03 11:05 Jonas Theisen
  2026-08-05  8:49 ` Elias Huhsovitz
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Theisen @ 2026-08-03 11:05 UTC (permalink / raw)
  To: pve-devel

On VM creation the storage dropdown for EFI and TPM were empty,
while the storage for VM disks was populated by default.

This commit adds the parameters to the selectors to also populate
the storage for EFI and TPM disks automatically.

Reported by a forum user in https://forum.proxmox.com/threads/185473/

Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
 www/manager6/qemu/HDEfi.js      | 1 +
 www/manager6/qemu/HDTPM.js      | 1 +
 www/manager6/qemu/SystemEdit.js | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/www/manager6/qemu/HDEfi.js b/www/manager6/qemu/HDEfi.js
index 1ae63add..b093a5d9 100644
--- a/www/manager6/qemu/HDEfi.js
+++ b/www/manager6/qemu/HDEfi.js
@@ -63,6 +63,7 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
                 nodename: me.nodename,
                 disabled: me.disabled,
                 hideSize: true,
+                autoSelect: me.insideWizard,
             },
             {
                 xtype: 'proxmoxcheckbox',
diff --git a/www/manager6/qemu/HDTPM.js b/www/manager6/qemu/HDTPM.js
index 947e3738..ee51b9ce 100644
--- a/www/manager6/qemu/HDTPM.js
+++ b/www/manager6/qemu/HDTPM.js
@@ -55,6 +55,7 @@ Ext.define('PVE.qemu.TPMDiskInputPanel', {
                 nodename: me.nodename,
                 disabled: me.disabled,
                 hideSize: true,
+                autoSelect: me.insideWizard,
             },
             {
                 xtype: 'proxmoxKVComboBox',
diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js
index 299be5f8..458cb493 100644
--- a/www/manager6/qemu/SystemEdit.js
+++ b/www/manager6/qemu/SystemEdit.js
@@ -137,6 +137,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
             hidden: true,
             hideSize: true,
             usesEFI: true,
+            insideWizard: true,
         },
     ],
 
@@ -184,6 +185,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
             },
             disabled: true,
             hidden: true,
+            insideWizard: true,
         },
     ],
 });
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH pve-manager] Web UI: VM creation Wizard: Pupulate EFI and TPM storage by default
  2026-08-03 11:05 [PATCH pve-manager] Web UI: VM creation Wizard: Pupulate EFI and TPM storage by default Jonas Theisen
@ 2026-08-05  8:49 ` Elias Huhsovitz
  2026-08-05 10:03   ` Jonas Theisen
  0 siblings, 1 reply; 4+ messages in thread
From: Elias Huhsovitz @ 2026-08-05  8:49 UTC (permalink / raw)
  To: Jonas Theisen, pve-devel

Nice quality of life change! Just one small bug:

The "EFI Storage" and "TPM Storage" fields are only populated the first
time the options are selected.

Repeatedly selecting/unselecting the checkboxes "Addi EFI Disk" and "Add
TPM", will not cause the respective storage fields to be populated, reverting 
to the old behaviour.

On Mon Aug 3, 2026 at 1:05 PM CEST, Jonas Theisen wrote:
> On VM creation the storage dropdown for EFI and TPM were empty,
> while the storage for VM disks was populated by default.
>
> This commit adds the parameters to the selectors to also populate
> the storage for EFI and TPM disks automatically.
>
> Reported by a forum user in https://forum.proxmox.com/threads/185473/
>
> Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
> ---
>  www/manager6/qemu/HDEfi.js      | 1 +
>  www/manager6/qemu/HDTPM.js      | 1 +
>  www/manager6/qemu/SystemEdit.js | 2 ++
>  3 files changed, 4 insertions(+)
>
> diff --git a/www/manager6/qemu/HDEfi.js b/www/manager6/qemu/HDEfi.js
> index 1ae63add..b093a5d9 100644
> --- a/www/manager6/qemu/HDEfi.js
> +++ b/www/manager6/qemu/HDEfi.js
> @@ -63,6 +63,7 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
>                  nodename: me.nodename,
>                  disabled: me.disabled,
>                  hideSize: true,
> +                autoSelect: me.insideWizard,
>              },
>              {
>                  xtype: 'proxmoxcheckbox',
> diff --git a/www/manager6/qemu/HDTPM.js b/www/manager6/qemu/HDTPM.js
> index 947e3738..ee51b9ce 100644
> --- a/www/manager6/qemu/HDTPM.js
> +++ b/www/manager6/qemu/HDTPM.js
> @@ -55,6 +55,7 @@ Ext.define('PVE.qemu.TPMDiskInputPanel', {
>                  nodename: me.nodename,
>                  disabled: me.disabled,
>                  hideSize: true,
> +                autoSelect: me.insideWizard,
>              },
>              {
>                  xtype: 'proxmoxKVComboBox',
> diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js
> index 299be5f8..458cb493 100644
> --- a/www/manager6/qemu/SystemEdit.js
> +++ b/www/manager6/qemu/SystemEdit.js
> @@ -137,6 +137,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
>              hidden: true,
>              hideSize: true,
>              usesEFI: true,
> +            insideWizard: true,
>          },
>      ],
>  
> @@ -184,6 +185,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
>              },
>              disabled: true,
>              hidden: true,
> +            insideWizard: true,
>          },
>      ],
>  });





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH pve-manager] Web UI: VM creation Wizard: Pupulate EFI and TPM storage by default
  2026-08-05  8:49 ` Elias Huhsovitz
@ 2026-08-05 10:03   ` Jonas Theisen
  2026-08-05 13:52     ` [PATCH manager] ui: vm: create: fix autoSelect for disk storage selector when re-enabling field Elias Huhsovitz
  0 siblings, 1 reply; 4+ messages in thread
From: Jonas Theisen @ 2026-08-05 10:03 UTC (permalink / raw)
  To: Elias Huhsovitz, pve-devel

On 8/5/26 10:49, Elias Huhsovitz wrote:
> Nice quality of life change! Just one small bug:
>
> The "EFI Storage" and "TPM Storage" fields are only populated the first
> time the options are selected.
>
> Repeatedly selecting/unselecting the checkboxes "Addi EFI Disk" and "Add
> TPM", will not cause the respective storage fields to be populated, reverting
> to the old behaviour.
According to my very limited knowledge of Javascript and our implementation
this might be expected or working as intended?

Since the autoSelect property is mapped as a CBind in
[pve-manager.git] / www / manager6 / form / IsoSelector.js
> 76             cbind: {
> 77                 nodename: '{nodename}',
> 78                 autoSelect: '{insideWizard}',
> 79                 insideWizard: '{insideWizard}',
> 80                 disabled: '{disabled}',
> 81                 labelWidth: '{labelWidth}',
> 82                 labelAlign: '{labelAlign}',
> 83             }
and [proxmox-widget-toolkit.git] / src / mixin / CBind.js states
> 2  * The Proxmox CBind mixin is intended to supplement the 'bind' 
> mechanism
> 3  * of ExtJS. In contrast to the 'bind', 'cbind' only acts during the 
> creation
> 4  * of the component, not during its lifetime. It's only applied once 
> before
> 5  * the 'initComponent' method is executed, and thus you have only access
> 6  * to the basic initial configuration of it.
i assume the selector is not recreated after un- and reticking the checkbox.

For regular disks this situation never arose afaict since the entry is 
always
freshly created.

I currently don't know where to look for the culprit here or maybe am even
on the wrong track and am open for suggestions.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH manager] ui: vm: create: fix autoSelect for disk storage selector when re-enabling field
  2026-08-05 10:03   ` Jonas Theisen
@ 2026-08-05 13:52     ` Elias Huhsovitz
  0 siblings, 0 replies; 4+ messages in thread
From: Elias Huhsovitz @ 2026-08-05 13:52 UTC (permalink / raw)
  To: j.theisen; +Cc: e.huhsovitz, pve-devel

The `autoSelect` configuration in `DiskStorageSelector` relies on the
underlying `ComboGrid` store's `load` event to select the first
available storage.

When the field is disabled and subsequently re-enabled, the
`load` event does not fire again. Consequently, the field remains
empty despite `autoSelect` being configured.

Fix this by explicitly handling the auto-selection logic inside the
`setDisabled` method. When the field is being enabled and is
currently empty, select the first record from the cached store.

Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
My knowledge of javacsript is also very limited, but this small
patch is how i would fix this.

TL;DR:
The original code only triggered autoSelect when the storage list downloaded
from the server. Toggling the checkbox does not trigger a new download, so
the event never fired again.

The fix intercepts the exact moment the field turns back on. It manually grabs
the first storage from the browser's existing memory cache and sets it
immediately.

Let me know what you think of this approach.

Note: I also noticed that your commit message has a typo.
"Pupulate" -> "Populate"

 www/manager6/form/DiskStorageSelector.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/www/manager6/form/DiskStorageSelector.js b/www/manager6/form/DiskStorageSelector.js
index 696f9033..f0af07ec 100644
--- a/www/manager6/form/DiskStorageSelector.js
+++ b/www/manager6/form/DiskStorageSelector.js
@@ -117,6 +117,11 @@ Ext.define('PVE.form.DiskStorageSelector', {
         // reset on disable
         if (value) {
             hdstorage.setValue();
+        } else if (me.autoSelect && !hdstorage.getValue()) {
+            let rec = hdstorage.getStore().first();
+            if (rec && rec.data) {
+                hdstorage.setValue(rec.data[hdstorage.valueField], true);
+            }
         }
         hdstorage.setDisabled(value);

--
2.47.3




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-05 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 11:05 [PATCH pve-manager] Web UI: VM creation Wizard: Pupulate EFI and TPM storage by default Jonas Theisen
2026-08-05  8:49 ` Elias Huhsovitz
2026-08-05 10:03   ` Jonas Theisen
2026-08-05 13:52     ` [PATCH manager] ui: vm: create: fix autoSelect for disk storage selector when re-enabling field Elias Huhsovitz

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