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 BE2BB1FF09B for ; Mon, 26 Oct 2026 23:05:01 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B89D3215DA; Mon, 26 Oct 2026 23:04:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datenzelt.de; s=MBO0001; t=1793052277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SnyoMdPtlLV8zf/QFashxA8iOgTdzQNhzjKlfERB1qI=; b=wPc70JMywhRC4owK5qlw9tsFyFQffS+s/zI9A/t+xKv3a/puxv4VLpgX7cVSr3+TlMXmOr JD8IzW8vij+29/hlt3wK9WYoZUs95qAyAQDu3o22SoZWl1AWNbVfKZeA8BOPm0te12St3P k9sEwe9YS1+ThLhfg7zmg9h4OCi/r7+pYpq+POlNhvgWw1UBMPJiSLNdw3n+JQ/uwBDAeB Z4MK8JJgIpEmeb2/34/JnsGWPFsRsHLx7xVA0zDlE2YWuKsgbhq1/tOpekrZaSYG/uWdsJ 3gRpUtrn008GREz6jPk/v2qaDRVw+ESbYMjaXjozmeuw7ib0Lz+qi7cRHlnXCw== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of timo.meschkat@datenzelt.de designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=timo.meschkat@datenzelt.de From: Timo Meschkat To: pve-devel@lists.proxmox.com Subject: [RFC PATCH manager 4/4] ui: disk resize: allow selecting the size unit Date: Mon, 26 Oct 2026 23:04:23 +0100 Message-ID: <20261026220423.127776-8-timo.meschkat@datenzelt.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261026220423.127776-1-timo.meschkat@datenzelt.de> References: <20261026220423.127776-1-timo.meschkat@datenzelt.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4jD72Y5YvBzMlPT X-SPAM-LEVEL: Spam detection results: 0 AWL 0.117 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: SWYQ7CCJR2WIUOPZ7B47ZH7VTSXSAX62 X-Message-ID-Hash: SWYQ7CCJR2WIUOPZ7B47ZH7VTSXSAX62 X-MailFrom: timo.meschkat@datenzelt.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Same as when creating disks, the increment could only be entered in GiB so far. GiB stays the default. The increment is now sent in MiB, e.g. '+1536M' instead of '+1.5G', which the API handles the same way. The VM resize window gets wider to fit the unit selector. Signed-off-by: Timo Meschkat --- www/manager6/lxc/MPResize.js | 11 +++++++---- www/manager6/qemu/HDResize.js | 13 ++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/www/manager6/lxc/MPResize.js b/www/manager6/lxc/MPResize.js index 658123a1..5a9bb9cb 100644 --- a/www/manager6/lxc/MPResize.js +++ b/www/manager6/lxc/MPResize.js @@ -5,7 +5,7 @@ Ext.define('PVE.window.MPResize', { resize_disk: function (disk, size) { var me = this; - var params = { disk: disk, size: '+' + size + 'G' }; + var params = { disk: disk, size: `+${size}M` }; Proxmox.Utils.API2Request({ params: params, @@ -46,13 +46,16 @@ Ext.define('PVE.window.MPResize', { }, ]; - me.hdsizesel = Ext.createWidget('numberfield', { + me.hdsizesel = Ext.createWidget('pmxSizeUnitField', { name: 'size', + backendUnit: 'MiB', + unit: 'GiB', minValue: 0, - maxValue: 128 * 1024, + maxValue: 128 * 1024 * 1024, decimalPrecision: 3, value: '0', - fieldLabel: `${gettext('Size Increment')} (${gettext('GiB')})`, + fieldLabel: gettext('Size Increment'), + fieldDescription: gettext('Capacity to add to the disk'), allowBlank: false, }); diff --git a/www/manager6/qemu/HDResize.js b/www/manager6/qemu/HDResize.js index 574bfb5a..41e7c90e 100644 --- a/www/manager6/qemu/HDResize.js +++ b/www/manager6/qemu/HDResize.js @@ -5,7 +5,7 @@ Ext.define('PVE.window.HDResize', { resize_disk: function (disk, size) { var me = this; - var params = { disk: disk, size: '+' + size + 'G' }; + var params = { disk: disk, size: `+${size}M` }; Proxmox.Utils.API2Request({ params: params, @@ -47,13 +47,16 @@ Ext.define('PVE.window.HDResize', { }, ]; - me.hdsizesel = Ext.createWidget('numberfield', { + me.hdsizesel = Ext.createWidget('pmxSizeUnitField', { name: 'size', + backendUnit: 'MiB', + unit: 'GiB', minValue: 0, - maxValue: 128 * 1024, + maxValue: 128 * 1024 * 1024, decimalPrecision: 3, value: '0', - fieldLabel: `${gettext('Size Increment')} (${gettext('GiB')})`, + fieldLabel: gettext('Size Increment'), + fieldDescription: gettext('Capacity to add to the disk'), allowBlank: false, }); @@ -86,7 +89,7 @@ Ext.define('PVE.window.HDResize', { Ext.apply(me, { modal: true, - width: 250, + width: 350, height: 150, border: false, layout: 'fit', -- 2.47.3