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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8AE3090F1B for ; Tue, 6 Sep 2022 14:51:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7EE0C282C4 for ; Tue, 6 Sep 2022 14:51:54 +0200 (CEST) Received: from lana.proxmox.com (unknown [94.136.29.99]) by firstgate.proxmox.com (Proxmox) with ESMTP for ; Tue, 6 Sep 2022 14:51:53 +0200 (CEST) Received: by lana.proxmox.com (Postfix, from userid 10043) id C659F2C0939; Tue, 6 Sep 2022 14:43:13 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Tue, 6 Sep 2022 14:43:04 +0200 Message-Id: <20220906124304.3049555-1-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.001 Envelope sender has no MX or A DNS records RDNS_NONE 0.793 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [data.name] Subject: [pve-devel] [PATCH pve-manager] fix #4228: Display warning when user rollbacks a running container. 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 Sep 2022 12:51:54 -0000 Signed-off-by: Stefan Hanreich --- I would love to put parentheses around the ternary expression at line 265, but eslint complains about unnecessary parentheses. Disabling an eslint rule is probably not so exciting for my first contribution, even if it would be for only one line. www/manager6/tree/SnapshotTree.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/www/manager6/tree/SnapshotTree.js b/www/manager6/tree/SnapshotTree.js index 97268072..d2fd50d7 100644 --- a/www/manager6/tree/SnapshotTree.js +++ b/www/manager6/tree/SnapshotTree.js @@ -259,8 +259,16 @@ Ext.define('PVE.guest.SnapshotTree', { let view = this.up('treepanel'); let rec = view.getSelection()[0]; let vmid = view.getViewModel().get('vmid'); - return Proxmox.Utils.format_task_description('qmrollback', vmid) + - ` '${rec.data.name}'? ${gettext("Current state will be lost.")}`; + + let type = view.getViewModel().get('type'); + let isRunning = view.getViewModel().get('running'); + let containerWarning = type === 'lxc' && isRunning + ? `
${gettext("The container is currently running and will be stopped!")}` + : ``; + + return Proxmox.Utils.format_task_description('qmrollback', vmid) + + ` '${rec.data.name}'? ${gettext("Current state will be lost.")}` + + containerWarning; }, handler: 'rollback', }, -- 2.30.2