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 D96F69E32C for ; Tue, 6 Jun 2023 17:04:45 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ADF4537BFA for ; Tue, 6 Jun 2023 17:04:45 +0200 (CEST) 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, 6 Jun 2023 17:04:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7A4D648C82 for ; Tue, 6 Jun 2023 17:04:44 +0200 (CEST) Message-ID: Date: Tue, 6 Jun 2023 17:04:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB, de-AT To: Proxmox VE development discussion , Leo Nunner References: <20230324161223.168531-1-l.nunner@proxmox.com> From: Thomas Lamprecht Autocrypt: addr=t.lamprecht@proxmox.com; keydata= xsFNBFsLjcYBEACsaQP6uTtw/xHTUCKF4VD4/Wfg7gGn47+OfCKJQAD+Oyb3HSBkjclopC5J uXsB1vVOfqVYE6PO8FlD2L5nxgT3SWkc6Ka634G/yGDU3ZC3C/7NcDVKhSBI5E0ww4Qj8s9w OQRloemb5LOBkJNEUshkWRTHHOmk6QqFB/qBPW2COpAx6oyxVUvBCgm/1S0dAZ9gfkvpqFSD 90B5j3bL6i9FIv3YGUCgz6Ue3f7u+HsEAew6TMtlt90XV3vT4M2IOuECG/p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qirC/Q1Y1lnbNTynPk IflgvsJjoTNZjgu1wUdQlBgL/JhUp1sIYID11jZphgzfDgp/E6ve/8xE2HMAnf4zAfJaKgD0 F+fL1DlcdYUditAiYEuN40Ns/abKs8I1MYx7Yglu3RzJfBzV4t86DAR+OvuF9v188WrFwXCS RSf4DmJ8tntyNej+DVGUnmKHupLQJO7uqCKB/1HLlMKc5G3GLoGqJliHjUHUAXNzinlpE2Vj C78pxpwxRNg2ilE3AhPoAXrY5qED5PLE9sLnmQ9AzRcMMJUXjTNEDxEYbF55SdGBHHOAcZtA kEQKub86e+GHA+Z8oXQSGeSGOkqHi7zfgW1UexddTvaRwE6AyZ6FxTApm8wq8NT2cryWPWTF BDSGB3ujWHMM8ERRYJPcBSjTvt0GcEqnd+OSGgxTkGOdufn51oz82zfpVo1t+J/FNz6MRMcg 8nEC+uKvgzH1nujxJ5pRCBOquFZaGn/p71Yr0oVitkttLKblFsqwa+10Lt6HBxm+2+VLp4Ja 0WZNncZciz3V3cuArpan/ZhhyiWYV5FD0pOXPCJIx7WS9PTtxiv0AOS4ScWEUmBxyhFeOpYa DrEx In-Reply-To: <20230324161223.168531-1-l.nunner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.085 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH v3 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, 06 Jun 2023 15:04:45 -0000 Am 24/03/2023 um 17:12 schrieb Leo Nunner: > 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 > --- > Changes since v2: > - Factor out edit tab into separate component > - Add vtype for instant validation feedback to the user > - Introduce tab for CephFS > > www/manager6/Makefile | 1 + > www/manager6/Toolkit.js | 2 + > www/manager6/panel/ContentDirs.js | 102 +++++++++++++++++++++++++++++ > www/manager6/storage/CIFSEdit.js | 9 +++ > www/manager6/storage/CephFSEdit.js | 9 +++ > www/manager6/storage/DirEdit.js | 9 +++ > www/manager6/storage/NFSEdit.js | 9 +++ > 7 files changed, 141 insertions(+) > create mode 100644 www/manager6/panel/ContentDirs.js > > diff --git a/www/manager6/Makefile b/www/manager6/Makefile > index 2b577c8e..cb07b5b8 100644 > --- a/www/manager6/Makefile > +++ b/www/manager6/Makefile > @@ -96,6 +96,7 @@ JSSRC= \ > panel/GuestSummary.js \ > panel/TemplateStatusView.js \ > panel/MultiDiskEdit.js \ > + panel/ContentDirs.js \ > tree/ResourceTree.js \ > tree/SnapshotTree.js \ > window/Backup.js \ > diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js > index f69c376a..0c801d45 100644 > --- a/www/manager6/Toolkit.js > +++ b/www/manager6/Toolkit.js > @@ -15,6 +15,8 @@ Ext.apply(Ext.form.field.VTypes, { > IP64AddressListMask: /[A-Fa-f0-9,:.; ]/, > PciIdText: gettext('Example') + ': 0x8086', > PciId: v => /^0x[0-9a-fA-F]{4}$/.test(v), > + ContentDirText: gettext('Example') + ': custom/subdir/location', > + ContentDir: v => /([^.]*(?:\.?[^.]+)+)/.test(v), > }); > > Ext.define('PVE.form.field.Display', { > diff --git a/www/manager6/panel/ContentDirs.js b/www/manager6/panel/ContentDirs.js > new file mode 100644 > index 00000000..57939101 > --- /dev/null > +++ b/www/manager6/panel/ContentDirs.js > @@ -0,0 +1,102 @@ > +Ext.define('PVE.panel.ContentDirsPanel', { > + extend: 'Proxmox.panel.InputPanel', > + xtype: 'pveContentDirsTab', > + mixins: ['Proxmox.Mixin.CBind'], > + > + onGetValues: function(values) { > + let me = this; > + let ret = me.values ?? {}; > + Object.keys(values || {}).forEach(function(name) { > + ret[name] = values[name]; > + }); > + return { "content-dirs": PVE.Parser.printPropertyString(ret) }; > + }, > + > + onSetValues: function(values) { > + let me = this; > + me.values = values?.["content-dirs"]; > + return me.values; > + }, > + > + column1: [ > + { > + xtype: 'pmxDisplayEditField', > + name: 'vztmpl', > + fieldLabel: gettext('CT Template'), > + allowBlank: true, > + emptyText: "template/cache", > + vtype: "ContentDir", > + editable: true, > + }, > + { > + xtype: 'pmxDisplayEditField', > + name: 'iso', > + fieldLabel: gettext('ISO Image'), > + allowBlank: true, > + emptyText: "template/iso", > + vtype: "ContentDir", > + editable: true, > + }, > + { > + xtype: 'pmxDisplayEditField', > + name: 'snippets', > + fieldLabel: gettext('Snippets'), > + allowBlank: true, > + emptyText: "snippets", > + vtype: "ContentDir", > + editable: true, > + }, I'd add an advanced section and move above into it. > + ], > + column2: [ > + { > + xtype: 'pmxDisplayEditField', > + name: 'backup', > + fieldLabel: gettext('Backup Files'), > + allowBlank: true, > + emptyText: "dump", > + vtype: "ContentDir", > + cbind: { > + editable: '{isCreate}', > + }, > + }, > + { > + xtype: 'pmxDisplayEditField', > + name: 'rootdir', > + fieldLabel: gettext('Container'), this is misleading, it's not for Container volumes but rather expanded Container root-directories, something from OpenVZ times, which we don't fully support anymore IIRC. If, I'd place this into advanced and use a different name to convey that. > + allowBlank: true, > + emptyText: "private", > + vtype: "ContentDir", > + cbind: { > + editable: '{isCreate}', > + }, > + }, > + { > + xtype: 'pmxDisplayEditField', > + name: 'images', > + fieldLabel: gettext('Disk Image'), Maybe call this 'Guest Volumes' or 'Guest Images' if it really has to be images. > + allowBlank: true, > + emptyText: "images", > + vtype: "ContentDir", > + cbind: { > + editable: '{isCreate}', > + }, > + }, > + ], > + columnT: [ > + { > + xtype: 'displayfield', > + userCls: 'pmx-hint', > + value: gettext('Editing overrides for existing storages might affect guests. Proceed with caution.'), > + cbind: { > + hidden: '{isCreate}', > + }, > + }, > + ], > + columnB: [ > + { > + xtype: 'displayfield', > + userCls: 'pmx-hint', > + value: gettext('Paths are relative to the mountpoint of the storage.'), > + },> + ], > +}); > diff --git a/www/manager6/storage/CIFSEdit.js b/www/manager6/storage/CIFSEdit.js > index 71415401..a3e7d3ea 100644 > --- a/www/manager6/storage/CIFSEdit.js > +++ b/www/manager6/storage/CIFSEdit.js > @@ -218,6 +218,15 @@ Ext.define('PVE.storage.CIFSInputPanel', { > }, > ]; > > + me.extraTabs = [ > + { > + xtype: 'pveContentDirsTab', > + title: gettext("Content Directories"), > + onlineHelp: me.onlineHelp, > + isCreate: me.isCreate, > + }, > + ]; > + > me.callParent(); > }, > }); > diff --git a/www/manager6/storage/CephFSEdit.js b/www/manager6/storage/CephFSEdit.js > index 6a95a00a..7558a052 100644 > --- a/www/manager6/storage/CephFSEdit.js > +++ b/www/manager6/storage/CephFSEdit.js > @@ -129,6 +129,15 @@ Ext.define('PVE.storage.CephFSInputPanel', { > }, > ]; > > + me.extraTabs = [ > + { > + xtype: 'pveContentDirsTab', > + title: gettext("Content Directories"), > + onlineHelp: me.onlineHelp, > + isCreate: me.isCreate, > + }, > + ]; > + > me.callParent(); > }, > }); > diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js > index 7e9ec44d..d1ae46cc 100644 > --- a/www/manager6/storage/DirEdit.js > +++ b/www/manager6/storage/DirEdit.js > @@ -33,6 +33,15 @@ Ext.define('PVE.storage.DirInputPanel', { > }, > ]; > > + me.extraTabs = [ > + { > + xtype: 'pveContentDirsTab', > + title: gettext("Content Directories"), > + onlineHelp: me.onlineHelp, > + isCreate: me.isCreate, > + }, > + ]; > + > me.callParent(); > }, > }); > diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js > index 202c7de0..13a17e3b 100644 > --- a/www/manager6/storage/NFSEdit.js > +++ b/www/manager6/storage/NFSEdit.js > @@ -160,6 +160,15 @@ Ext.define('PVE.storage.NFSInputPanel', { > }, > ]; > > + me.extraTabs = [ > + { > + xtype: 'pveContentDirsTab', > + title: gettext("Content Directories"), > + onlineHelp: me.onlineHelp, > + isCreate: me.isCreate, > + }, > + ]; > + > me.callParent(); > }, > });