[pve-devel] [PATCH pve-manager] fix #4228: Display warning when user rollbacks a running container.
Stefan Hanreich
s.hanreich at proxmox.com
Tue Sep 6 14:43:04 CEST 2022
Signed-off-by: Stefan Hanreich <s.hanreich at 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
More information about the pve-devel
mailing list