From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 4CEF71FF15F for ; Mon, 18 Nov 2024 16:31:04 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0ED4F13831; Mon, 18 Nov 2024 16:29:45 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Mon, 18 Nov 2024 16:29:25 +0100 Message-Id: <20241118152928.858590-23-d.csapak@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241118152928.858590-1-d.csapak@proxmox.com> References: <20241118152928.858590-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.016 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v7 6/9] ui: guest import: add storage selector for ova extraction storage X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" but only when we detect the 'ova-needs-extraction' warning. This can be used to select the storage where the disks contained in an OVA will be extracted to temporarily. Signed-off-by: Dominik Csapak --- changes from v6: * adapted to new parameter * reworded import working storage label www/manager6/window/GuestImport.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/www/manager6/window/GuestImport.js b/www/manager6/window/GuestImport.js index 1a08195e..7c263241 100644 --- a/www/manager6/window/GuestImport.js +++ b/www/manager6/window/GuestImport.js @@ -303,6 +303,7 @@ Ext.define('PVE.window.GuestImport', { os: 'l26', maxCdDrives: false, uniqueMACAdresses: false, + isOva: false, warnings: [], }, @@ -432,6 +433,10 @@ Ext.define('PVE.window.GuestImport', { } } + if (config['import-working-storage'] === '') { + delete config['import-working-storage']; + } + return config; }, @@ -553,6 +558,22 @@ Ext.define('PVE.window.GuestImport', { allowBlank: false, fieldLabel: gettext('Default Bridge'), }, + { + xtype: 'pveStorageSelector', + reference: 'extractionStorage', + fieldLabel: gettext('Import Working Storage'), + storageContent: 'images', + emptyText: gettext('Import Storage'), + autoSelect: false, + name: 'import-working-storage', + disabled: true, + hidden: true, + allowBlank: true, + bind: { + disabled: '{!isOva}', + hidden: '{!isOva}', + }, + }, ], columnB: [ @@ -925,6 +946,7 @@ Ext.define('PVE.window.GuestImport', { me.lookup('defaultStorage').setNodename(me.nodename); me.lookup('defaultBridge').setNodename(me.nodename); + me.lookup('extractionStorage').setNodename(me.nodename); let renderWarning = w => { const warningsCatalogue = { @@ -1006,6 +1028,7 @@ Ext.define('PVE.window.GuestImport', { } me.getViewModel().set('warnings', data.warnings.map(w => renderWarning(w))); + me.getViewModel().set('isOva', data.warnings.map(w => w.type).indexOf('ova-needs-extracting') !== -1); let osinfo = PVE.Utils.get_kvm_osinfo(me.vmConfig.ostype ?? ''); let prepareForVirtIO = (me.vmConfig.ostype ?? '').startsWith('w') && (me.vmConfig.bios ?? '').indexOf('ovmf') !== -1; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel