[pve-devel] [PATCH manager 1/4] ui: guest import: fix isWindows check

Dominik Csapak d.csapak at proxmox.com
Tue Mar 19 14:00:29 CET 2024


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 at proxmox.com>
---
 www/manager6/window/GuestImport.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/www/manager6/window/GuestImport.js b/www/manager6/window/GuestImport.js
index 443bc886..81e9074e 100644
--- a/www/manager6/window/GuestImport.js
+++ b/www/manager6/window/GuestImport.js
@@ -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,
 		    });
-- 
2.39.2





More information about the pve-devel mailing list