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 584A97D66E for ; Tue, 9 Nov 2021 11:08:28 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4A9DF88CE for ; Tue, 9 Nov 2021 11:08:28 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 5AFD888BF for ; Tue, 9 Nov 2021 11:08:27 +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 297E742579 for ; Tue, 9 Nov 2021 11:08:27 +0100 (CET) Message-ID: Date: Tue, 9 Nov 2021 11:08:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Thunderbird/95.0 Content-Language: en-US To: Proxmox VE development discussion , Aaron Lauterer References: <20211108095612.193819-1-a.lauterer@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20211108095612.193819-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.099 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 PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far 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] applied: [PATCH manager] ui: lxc: resources: add Detach text for mountpoints 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, 09 Nov 2021 10:08:28 -0000 On 08.11.21 10:56, Aaron Lauterer wrote: > Instead of showing 'Remove' for a mountpoint, change the text to > 'Detach' and only show 'Remove' for unused volumes. > > This aligns the behaviour with VMs and will make it clear, that a > mountpoint first needs to be detached before it can be fully removed. > > Signed-off-by: Aaron Lauterer > --- > I took the code from the qemu/HardwareView.js and only made minor > changes to the check if it is a used disk/volume. > Since it is only a minor change, I did not go all the way to modernize > it and also stayed with `var ...` instead of `let ...` when defining the > `isUsedDisk` variable for consistency. > > www/manager6/lxc/Resources.js | 31 +++++++++++++++++++++++++++++-- > 1 file changed, 29 insertions(+), 2 deletions(-) > > applied, thanks! albeit... > @@ -191,12 +191,21 @@ Ext.define('PVE.lxc.RessourceView', { > > var remove_btn = new Proxmox.button.Button({ > text: gettext('Remove'), > + defaultText: gettext('Remove'), > + altText: gettext('Detach'), > selModel: me.selModel, > disabled: true, > dangerous: true, > confirmMsg: function(rec) { > - var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'), > - "'" + me.renderKey(rec.data.key, {}, rec) + "'"); > + let warn = Ext.String.format(gettext('Are you sure you want to remove entry {0}')); > + if (this.text === this.altText) { > + warn = gettext('Are you sure you want to detach entry {0}'); > + } > + > + let key = rec.data.key; above was only used partially, i.e., in renderKey but not for the match which is actually new vs. just copypasta'd code from the QEMU variant. FYI: I dropped it completely and modernized the QEMU variant too in a followup. > + > + let rendered = me.renderKey(key, {}, rec); > + let msg = Ext.String.format(warn, "'" + rendered + "'"); > if (rec.data.key.match(/^unused\d+$/)) { > msg += " " + gettext('This will permanently erase all data.'); > }