]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: guest import: fix isWindows check
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 19 Mar 2024 13:00:29 +0000 (14:00 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 Mar 2024 17:16:00 +0000 (18:16 +0100)
while most of our 'windiows' ostypes start with 'win' not all of them do
(wxp, wvista), so just shorten the condition to 'starts with `w`', this
covers all our windows ostypes, while not including others.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/window/GuestImport.js

index 443bc8860465365f3bdedb90f7f79dcf6e55331f..81e9074eb9a1996b3f9ea62f8a4130d0ee67a0f3 100644 (file)
@@ -198,7 +198,7 @@ Ext.define('PVE.window.GuestImport', {
            let collection = store.getData().getSource() ?? store.getData();
            let rec = collection.find('autogenerated', true);
 
-           let isWindows = (value ?? '').startsWith('win');
+           let isWindows = (value ?? '').startsWith('w');
            if (rec) {
                rec.set('hidden', !isWindows);
                rec.commit();
@@ -275,7 +275,7 @@ Ext.define('PVE.window.GuestImport', {
                + get('warnings').map(w => `<li>${w}</li>`).join('') + '</ul>',
            liveImportNote: get => !get('liveImport') ? ''
                : gettext('Note: If anything goes wrong during the live-import, new data written by the VM may be lost.'),
-           isWindows: get => (get('os') ?? '').startsWith('win'),
+           isWindows: get => (get('os') ?? '').startsWith('w'),
        },
     },
 
@@ -925,7 +925,7 @@ Ext.define('PVE.window.GuestImport', {
                    me.additionalCdIdx = additionalCdIdx;
                    me.lookup('cdGrid').getStore().add({
                        enable: true,
-                       hidden: !(me.vmConfig.ostype ?? '').startsWith('win'),
+                       hidden: !(me.vmConfig.ostype ?? '').startsWith('w'),
                        id: additionalCdIdx,
                        autogenerated: true,
                    });