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 4DB551FF0E2 for ; Thu, 30 Jul 2026 11:41:16 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DA7B12132C; Thu, 30 Jul 2026 11:41:15 +0200 (CEST) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH manager v3 2/2] ui: storage: add mount options field for cephfs Date: Thu, 30 Jul 2026 11:40:55 +0200 Message-ID: <20260730094055.57659-3-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260730094055.57659-1-e.huhsovitz@proxmox.com> References: <20260730094055.57659-1-e.huhsovitz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785404462340 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.134 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: AVV4JKMKRZLTYXZNTEQPUN7NDGCNV7UY X-Message-ID-Hash: AVV4JKMKRZLTYXZNTEQPUN7NDGCNV7UY X-MailFrom: e.huhsovitz@proxmox.com 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 CC: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add a text field for custom mount options to the CephFS storage configuration dialog. This allows users to configure advanced mount parameters (like 'ms_mode' or 'mount_timeout') directly via the web interface, without needing to use the CLI or manually edit storage.cfg. When mount options are being changed: Display a hint to the user that changes will require remounting the storage to take effect. Reduce the usage of `var` keyword in CephFSEdit.js. Signed-off-by: Elias Huhsovitz --- www/manager6/storage/CephFSEdit.js | 59 +++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/www/manager6/storage/CephFSEdit.js b/www/manager6/storage/CephFSEdit.js index db54df87..1c7a9bd9 100644 --- a/www/manager6/storage/CephFSEdit.js +++ b/www/manager6/storage/CephFSEdit.js @@ -8,17 +8,46 @@ Ext.define('PVE.storage.CephFSInputPanel', { type: 'cephstorage', }, + onGetValues: function (values) { + const me = this; + + if (values.options) { + values.options = values.options + .split(',') + .map((opt) => opt.trim()) + .filter((opt, index, self) => opt !== '' && self.indexOf(opt) === index) + .join(','); + } + + if (!values.options) { + delete values.options; + if (!me.isCreate) { + values.delete = values.delete ? `${values.delete},options` : 'options'; + } + } + + return me.callParent([values]); + }, + setValues: function (values) { if (values.monhost) { this.viewModel.set('pveceph', false); this.lookupReference('pvecephRef').setValue(false); this.lookupReference('pvecephRef').resetOriginalValue(); } + + this.originalOptions = values.options || ''; + this.callParent([values]); + + const hint = this.down('#mountOptionsHint'); + if (hint) { + hint.setHidden(true); + } }, initComponent: function () { - var me = this; + const me = this; if (!me.nodename) { me.nodename = 'localhost'; @@ -132,6 +161,34 @@ Ext.define('PVE.storage.CephFSInputPanel', { }, ]; + me.advancedColumnB = me.advancedColumnB || []; + + me.advancedColumnB.push({ + xtype: 'textfield', + name: 'options', + fieldLabel: gettext('Mount Options'), + emptyText: `${gettext('Example')}: ms_mode=secure, mount_timeout=60`, + allowBlank: true, + listeners: { + change: function (field, newValue) { + const hint = me.down('#mountOptionsHint'); + if (hint) { + hint.setHidden(me.isCreate || (newValue || '') === me.originalOptions); + } + }, + }, + }); + + me.advancedColumnB.push({ + xtype: 'displayfield', + itemId: 'mountOptionsHint', + userCls: 'pmx-hint', + hidden: true, + value: gettext( + 'Changes to mount options require remounting the storage to take effect.', + ), + }); + me.callParent(); }, }); -- 2.47.3