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 35D601FF0ED for ; Fri, 31 Jul 2026 12:24:13 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8DE1C2175F; Fri, 31 Jul 2026 12:22:08 +0200 (CEST) From: Dietmar Maurer To: pve-devel@lists.proxmox.com Subject: [RFC pve-manager 18/27] ui: storage wizard: add SMB/CIFS support Date: Fri, 31 Jul 2026 12:21:47 +0200 Message-ID: <20260731102156.3947857-19-dietmar@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260731102156.3947857-1-dietmar@proxmox.com> References: <20260731102156.3947857-1-dietmar@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 2 AWL -0.220 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) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: FDKHXIGOOBE2NONWPA3UHDMLY2RSVRHB X-Message-ID-Hash: FDKHXIGOOBE2NONWPA3UHDMLY2RSVRHB X-MailFrom: dietmar@zilli.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: 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 --- www/manager6/Makefile | 1 + www/manager6/storage/wizard/CIFS.js | 117 ++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 www/manager6/storage/wizard/CIFS.js diff --git a/www/manager6/Makefile b/www/manager6/Makefile index 10340b5a..3020ca05 100644 --- a/www/manager6/Makefile +++ b/www/manager6/Makefile @@ -380,6 +380,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 00000000..d9e5f5cf --- /dev/null +++ b/www/manager6/storage/wizard/CIFS.js @@ -0,0 +1,117 @@ +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: (f, value) => shareField().setServer(value), + }, + }, + { + 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); + let wizard = me.up('window'); + wizard.scanNode = value; + wizard.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