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 78F101FF0AF for ; Fri, 06 Nov 2026 01:55:32 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C7F6621720; Fri, 06 Nov 2026 01:51:12 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH v3 manager 51/76] ui: storage wizard: add SMB/CIFS support Date: Fri, 6 Nov 2026 00:31:26 +0100 Message-ID: <20261105233336.2178064-52-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261105233336.2178064-1-t.lamprecht@proxmox.com> References: <20261105233336.2178064-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793926180933 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.312 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_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: NAIOM7TBDDPT7Q2OVPQUSFQ7U2ZJ25Z3 X-Message-ID-Hash: NAIOM7TBDDPT7Q2OVPQUSFQ7U2ZJ25Z3 X-MailFrom: t.lamprecht@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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Dietmar Maurer Reuse the CIFS share scanner from the edit dialog and keep the rarely needed domain and subdirectory options in the advanced section. Signed-off-by: Dietmar Maurer [TL: clear the selected share when the server changes; leave the scan node to its selector] Signed-off-by: Thomas Lamprecht --- www/manager6/Makefile | 1 + www/manager6/storage/wizard/CIFS.js | 118 ++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 www/manager6/storage/wizard/CIFS.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index b467e7ef5..7002518e0 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -381,6 +381,7 @@ JSSRC= \ storage/wizard/Wizard.js \ storage/wizard/CommonSettings.js \ storage/wizard/NFS.js \ + storage/wizard/CIFS.js \ Workspace.js \ # end of JSSRC list diff --git a/www/manager6/storage/wizard/CIFS.js b/www/manager6/storage/wizard/CIFS.js new file mode 100644 index 000000000..4c76a4846 --- /dev/null +++ b/www/manager6/storage/wizard/CIFS.js @@ -0,0 +1,118 @@ +Ext.define('PVE.storage.wizard.CIFSConnection', { + extend: 'Proxmox.panel.InputPanel', + xtype: 'pveStorageWizardCIFSConnection', + + onlineHelp: 'storage_cifs', + + onGetValues: function (values) { + ['username', 'password', 'domain', 'subdir'].forEach(function (opt) { + if (values[opt]?.length === 0) { + delete values[opt]; + } + }); + return values; + }, + + initComponent: function () { + let me = this; + + let shareField = () => me.down('field[name=share]'); + + me.column1 = [ + { + xtype: 'textfield', + name: 'server', + fieldLabel: gettext('Server'), + allowBlank: false, + listeners: { + change: function (f, value) { + shareField().setServer(value); + shareField().setValue(''); + }, + }, + }, + { + xtype: 'textfield', + name: 'username', + fieldLabel: gettext('Username'), + emptyText: gettext('Guest user'), + allowBlank: true, + listeners: { + change: (f, value) => shareField().setUsername(value), + }, + }, + { + xtype: 'textfield', + inputType: 'password', + name: 'password', + fieldLabel: gettext('Password'), + emptyText: gettext('None'), + minLength: 1, + allowBlank: true, + listeners: { + change: (f, value) => shareField().setPassword(value), + }, + }, + { + xtype: 'pveCIFSScan', + name: 'share', + fieldLabel: 'Share', + allowBlank: false, + }, + ]; + + me.column2 = []; + if (!PVE.Utils.isStandaloneNode()) { + me.column2.push({ + xtype: 'pveStorageScanNodeSelector', + listeners: { + change: function (f, value) { + shareField().setNodeName(value); + me.up('window').down('field[name=nodes]').setValue(value); + }, + }, + }); + } + + me.advancedColumn1 = [ + { + xtype: 'textfield', + name: 'domain', + fieldLabel: gettext('Domain'), + allowBlank: true, + listeners: { + change: (f, value) => shareField().setDomain(value), + }, + }, + ]; + + me.advancedColumn2 = [ + { + xtype: 'textfield', + name: 'subdir', + fieldLabel: gettext('Subdirectory'), + allowBlank: true, + emptyText: gettext('/some/path'), + }, + ]; + + me.callParent(); + }, +}); + +PVE.storage.wizard.types.cifs = { + text: 'SMB/CIFS', + description: gettext('Shared folder on a Windows server, NAS, or Samba server.'), + group: 'nas', + apiType: 'cifs', + steps: () => [ + { + xtype: 'pveStorageWizardCIFSConnection', + title: gettext('Connection'), + }, + ], + settings: { + onlineHelp: 'storage_cifs', + defaultContent: ['images'], + }, +}; -- 2.47.3