From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 0BCC6925D6 for ; Tue, 14 Mar 2023 14:16:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DFB0721352 for ; Tue, 14 Mar 2023 14:15:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 14 Mar 2023 14:15:33 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6082845788 for ; Tue, 14 Mar 2023 14:15:33 +0100 (CET) From: Leo Nunner To: pve-devel@lists.proxmox.com Date: Tue, 14 Mar 2023 14:14:55 +0100 Message-Id: <20230314131456.165418-3-l.nunner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230314131456.165418-1-l.nunner@proxmox.com> References: <20230314131456.165418-1-l.nunner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.104 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH v2 manager] gui: expose content-dirs property in storage edit/create X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2023 13:16:07 -0000 Add a separate tab for the storage edit/create panels to set the recently introduced "content-dirs" property which overrides the default directory locations. Analogous to the API implementation, the tab was added for Directory, CIFS and NFS storages. Signed-off-by: Leo Nunner --- www/manager6/storage/CIFSEdit.js | 8 +++ www/manager6/storage/DirEdit.js | 85 ++++++++++++++++++++++++++++++++ www/manager6/storage/NFSEdit.js | 8 +++ 3 files changed, 101 insertions(+) diff --git a/www/manager6/storage/CIFSEdit.js b/www/manager6/storage/CIFSEdit.js index 71415401..c909ccf2 100644 --- a/www/manager6/storage/CIFSEdit.js +++ b/www/manager6/storage/CIFSEdit.js @@ -218,6 +218,14 @@ Ext.define('PVE.storage.CIFSInputPanel', { }, ]; + me.extraTabs = [ + { + xtype: 'pveContentDirsTab', + title: gettext("Content Directories"), + onlineHelp: me.onlineHelp, + }, + ]; + me.callParent(); }, }); diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js index 7e9ec44d..f49aaeca 100644 --- a/www/manager6/storage/DirEdit.js +++ b/www/manager6/storage/DirEdit.js @@ -33,6 +33,91 @@ Ext.define('PVE.storage.DirInputPanel', { }, ]; + me.extraTabs = [ + { + xtype: 'pveContentDirsTab', + title: gettext("Content Directories"), + onlineHelp: me.onlineHelp, + }, + ]; + + me.callParent(); + }, +}); + +Ext.define('PVE.panel.ContentDirsPanel', { + extend: 'Proxmox.panel.InputPanel', + xtype: 'pveContentDirsTab', + + onGetValues: function(form) { + let str = PVE.Parser.printPropertyString(form); + let values = { "content-dirs": str }; + return values; + }, + + onSetValues: function(values) { + return values?.["content-dirs"]; + }, + + initComponent: function() { + let me = this; + + me.column1 = [ + { + xtype: 'textfield', + name: 'images', + fieldLabel: gettext('Disk image'), + allowBlank: true, + emptyText: "images", + }, + { + xtype: 'textfield', + name: 'iso', + fieldLabel: gettext('ISO image'), + allowBlank: true, + emptyText: "template/iso", + }, + { + xtype: 'textfield', + name: 'vztmpl', + fieldLabel: gettext('CT template'), + allowBlank: true, + emptyText: "template/cache", + }, + ]; + + me.column2 = [ + { + xtype: 'textfield', + name: 'backup', + fieldLabel: gettext('Backup files'), + allowBlank: true, + emptyText: "dump", + }, + { + xtype: 'textfield', + name: 'rootdir', + fieldLabel: gettext('Container'), + allowBlank: true, + emptyText: "private", + }, + { + xtype: 'textfield', + name: 'snippets', + fieldLabel: gettext('Snippets'), + allowBlank: true, + emptyText: "snippets", + }, + ]; + + me.columnB = [ + { + xtype: 'displayfield', + userCls: 'pmx-hint', + value: gettext('Paths are relative to the mountpoint of the storage'), + }, + ]; + me.callParent(); }, }); diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js index 202c7de0..606e1c02 100644 --- a/www/manager6/storage/NFSEdit.js +++ b/www/manager6/storage/NFSEdit.js @@ -160,6 +160,14 @@ Ext.define('PVE.storage.NFSInputPanel', { }, ]; + me.extraTabs = [ + { + xtype: 'pveContentDirsTab', + title: gettext("Content Directories"), + onlineHelp: me.onlineHelp, + }, + ]; + me.callParent(); }, }); -- 2.30.2