]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: guest import: correctly set default scsihw value
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 19 Mar 2024 13:00:31 +0000 (14:00 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 Mar 2024 17:16:21 +0000 (18:16 +0100)
we have to set it to '__default__' if we didn't get one from the API

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: fix-up eslint warning ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/window/GuestImport.js

index 719bab3169d9bb13c6e726eff1bc4e14dde490c6..e418c8cb2648992e9fd385911686e696dee05406 100644 (file)
@@ -204,7 +204,8 @@ Ext.define('PVE.window.GuestImport', {
                rec.commit();
            }
            let prepareVirtio = me.lookup('mapSata').getValue();
-           me.lookup('scsihw').setValue(prepareVirtio && isWindows ? 'virtio-scsi-single' : me.getView().vmConfig.scsihw);
+           let defaultScsiHw = me.getView().vmConfig.scsihw ?? '__default__';
+           me.lookup('scsihw').setValue(prepareVirtio && isWindows ? 'virtio-scsi-single' : defaultScsiHw);
 
            me.refreshGrids();
        },
@@ -662,6 +663,7 @@ Ext.define('PVE.window.GuestImport', {
                            xtype: 'pveScsiHwSelector',
                            reference: 'scsihw',
                            name: 'scsihw',
+                           value: '__default__',
                            submitValue: false,
                            fieldLabel: gettext('SCSI Controller'),
                        },