From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 114AA1FF0A7 for ; Wed, 30 Sep 2026 09:47:16 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 47808216E6; Wed, 30 Sep 2026 09:46:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1790690323; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=yQeHFiw+vJLwIbs1IpfGzp+VdimwnaUy/o0Aa3wXci8=; b=5Wr+Ffa/3Kowww5qTPR/lfajSXA938zYtJOlNat50+aPBQOp0VA0iYAfPkvHN+uUtOPgkC +eRDRHCY19YMSkQi8KQQsP+CAxOf775u3ZZlXpY7QJO+OsEjmRcb8ETsDosNWi7PNLASnN f/syQcxP0Bne8pk1EPHtKch7Om+jbIBvmurM6MqxEp77vdTGpiOoMGTvSuiaZF+Reumo4+ mOtOWtTgYraFDwck1YRM8DgZEkbLtrIgtOYUz3L7id7WSIVWc4atcMBOXFD+doEgpp2mAv hbcEw9plw1jec8Sh5OFaJwpukUobFTpu3UQ9Y5bcqemfJyGAL84orrhaig+1Mg== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager 2/2] fix #8015: ui: download url: let the user choose the .img image format Date: Tue, 29 Sep 2026 15:58:40 +0200 Message-ID: <20260929135840.2748665-3-me@dualfroz.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260929135840.2748665-1-me@dualfroz.com> References: <20260929135840.2748665-1-me@dualfroz.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.039 Adjusted score from AWL reputation of From: address DKIM_INVALID 0.1 DKIM or DK signature exists, but is not valid DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DMARC_PASS -0.1 DMARC pass policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: me@dualfroz.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: HDGNW4F2JZNBAY3XAG7NGL6LWVIJJ7QX X-Message-ID-Hash: HDGNW4F2JZNBAY3XAG7NGL6LWVIJJ7QX X-Mailman-Approved-At: Wed, 30 Sep 2026 09:46:15 +0200 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Like for the upload, '.raw' was appended to the name of '.img' images downloaded as import content, which breaks importing images in other formats, such as the qcow2 based Ubuntu cloud images. After querying the URL of such an image, show a format selector and append the extension of the selected format to the file name instead. Signed-off-by: Michal Fox --- www/manager6/window/DownloadUrlToStorage.js | 32 +++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/www/manager6/window/DownloadUrlToStorage.js b/www/manager6/window/DownloadUrlToStorage.js index f1c4392c..be31fb59 100644 --- a/www/manager6/window/DownloadUrlToStorage.js +++ b/www/manager6/window/DownloadUrlToStorage.js @@ -30,6 +30,7 @@ Ext.define('PVE.window.DownloadUrlToStorage', { size: '-', mimetype: '-', enableQuery: true, + needsFormat: false, }, }, @@ -82,6 +83,7 @@ Ext.define('PVE.window.DownloadUrlToStorage', { let filename = data.filename || ''; let compression = '__default__'; + let needsFormat = false; if (view.content === 'iso') { const matches = filename.match(/^(.+)\.(gz|lzo|zst|bz2)$/i); if (matches) { @@ -89,10 +91,12 @@ Ext.define('PVE.window.DownloadUrlToStorage', { compression = matches[2].toLowerCase(); } } else if (view.content === 'import') { - if (filename.endsWith('.img')) { - filename += '.raw'; - } + // the extension does not tell the image format, the user has to select it + needsFormat = filename.endsWith('.img'); } + me.queriedName = filename; + me.getViewModel().set('needsFormat', needsFormat); + me.lookup('imageFormat').setValue(null); view.setValues({ filename, @@ -106,6 +110,12 @@ Ext.define('PVE.window.DownloadUrlToStorage', { }); }, + formatChange: function (field, format) { + if (format) { + this.getView().setValues({ filename: `${this.queriedName}.${format}` }); + } + }, + hashChange: function (field) { let checksum = Ext.getCmp('downloadUrlChecksum'); if (field.getValue() === '__default__') { @@ -169,6 +179,22 @@ Ext.define('PVE.window.DownloadUrlToStorage', { return this.processRawValue(this.getRawValue())?.trim(); }, }, + { + xtype: 'pveDiskFormatSelector', + reference: 'imageFormat', + fieldLabel: gettext('Format'), + submitValue: false, + allowBlank: false, + hidden: true, + disabled: true, + bind: { + hidden: '{!needsFormat}', + disabled: '{!needsFormat}', + }, + listeners: { + change: 'formatChange', + }, + }, ], column1: [ { -- 2.43.0