public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-manager] fix #4228: Display warning when user rollbacks a running container.
@ 2022-09-06 12:43 Stefan Hanreich
  2022-09-07  7:59 ` Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hanreich @ 2022-09-06 12:43 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
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
+		    ? `<br/>${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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-07  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-06 12:43 [pve-devel] [PATCH pve-manager] fix #4228: Display warning when user rollbacks a running container Stefan Hanreich
2022-09-07  7:59 ` Thomas Lamprecht
2022-09-07  8:07   ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal