From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 6634B1FF2C6 for ; Wed, 10 Jul 2024 16:27:28 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1E669BC84; Wed, 10 Jul 2024 16:27:51 +0200 (CEST) Message-ID: <027c53ae-8915-4018-9e32-c91b895dcdca@proxmox.com> Date: Wed, 10 Jul 2024 16:18:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Christoph Heiss References: <20240710124300.295817-1-a.lauterer@proxmox.com> <20240710124300.295817-3-a.lauterer@proxmox.com> Content-Language: en-US From: Aaron Lauterer In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL -0.040 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 Subject: Re: [pve-devel] [PATCH manager 2/2] fix#5570 ui: ceph: make MDS ID configurable 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: , Reply-To: Proxmox VE development discussion Cc: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On 2024-07-10 15:59, Christoph Heiss wrote: > On Wed, Jul 10, 2024 at 02:43:00PM GMT, Aaron Lauterer wrote: >> [..] >> www/manager6/ceph/ServiceList.js | 21 +++++++++++---------- >> 1 file changed, 11 insertions(+), 10 deletions(-) >> >> diff --git a/www/manager6/ceph/ServiceList.js b/www/manager6/ceph/ServiceList.js >> index 76710146..9075f197 100644 >> --- a/www/manager6/ceph/ServiceList.js >> +++ b/www/manager6/ceph/ServiceList.js >> [..] >> @@ -40,15 +39,17 @@ Ext.define('PVE.CephCreateService', { >> listeners: { >> change: function(f, value) { >> let view = this.up('pveCephCreateService'); >> + view.lookup('mds-id').setValue(value); >> view.setNode(value); >> }, >> }, >> }, >> { >> xtype: 'textfield', >> - fieldLabel: gettext('Extra ID'), >> - regex: /[a-zA-Z0-9]+/, >> - regexText: gettext('ID may only consist of alphanumeric characters'), >> + reference: 'mds-id', >> + fieldLabel: gettext('MDS ID'), >> + regex: /^([a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?)$/, >> + regexText: gettext('ID may consist of alphanumeric characters and hyphen. It cannot start with a number or end in a hyphen.'), > > Is there a check in the backend whether the name ends with a hyphen? If > not, should there be one? Yes, the parameter checks [0] against the Ceph Service Regex [1] which is basically a hostname regex. > > Also, while at it, maybe also set `maxLength` to a sensible value? > E.g. while the API schema allows up to 200 characters, it then fails to > create a task log file with "File name too long" :^) > ~ 180 characters seem to be fine, but probably something like 128 > characters is already a pretty sensible limit. nice catch. we might want to lower the limit in the API then, and could also set the limit in the GUI. There might be other places in the API with a similar issue... glancing at all the other Ceph Services which can get customized names with the API/CLI. [0] https://git.proxmox.com/?p=pve-manager.git;a=blob;f=PVE/API2/Ceph/MDS.pm;h=6fc0ae450b7f65b5b5b70f72fb23f2b8dbef5a98;hb=HEAD#l107 [1] https://git.proxmox.com/?p=pve-manager.git;a=blob;f=PVE/Ceph/Services.pm;h=e0f31e8eb6bc9b3777b3d0d548497276efaa5c41;hb=HEAD#l14 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel