From: Nicolas Frey <n.frey@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 2/2] ui: fix #6209: create snapshots and backups from context menu
Date: Tue, 30 Sep 2025 15:01:34 +0200 [thread overview]
Message-ID: <20250930130134.101875-3-n.frey@proxmox.com> (raw)
In-Reply-To: <20250930130134.101875-1-n.frey@proxmox.com>
Adds snapshot and manual backup shortcut to VM/CT right-click context
menu.
Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6209
Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
---
| 45 ++++++++++++++++++++++++++++++++++++
| 45 ++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+)
--git a/www/manager6/lxc/CmdMenu.js b/www/manager6/lxc/CmdMenu.js
index cd60c967..6ab8b366 100644
--- a/www/manager6/lxc/CmdMenu.js
+++ b/www/manager6/lxc/CmdMenu.js
@@ -30,6 +30,17 @@ Ext.define('PVE.lxc.CmdMenu', {
});
};
+ let snapshotFeature;
+
+ Proxmox.Utils.API2Request({
+ url: `/nodes/${info.node}/${info.type}/${info.vmid}/feature`,
+ params: { feature: 'snapshot' },
+ method: 'GET',
+ success: function (response, _) {
+ snapshotFeature = !!response.result.data.hasFeature;
+ },
+ });
+
let caps = Ext.state.Manager.get('GuiCap');
let standalone = PVE.Utils.isStandaloneNode();
@@ -134,6 +145,40 @@ Ext.define('PVE.lxc.CmdMenu', {
},
},
{ xtype: 'menuseparator' },
+ {
+ text: gettext('Take Snapshot'),
+ iconCls: 'fa fa-fw fa-history',
+ disabled: !!caps.vms['VM.Snapshot'] && snapshotFeature,
+ handler: function () {
+
+ let win = Ext.create('PVE.window.Snapshot', {
+ nodename: info.node,
+ vmid: info.vmid,
+ vmname: info.name,
+ viewonly: !caps.vms['VM.Snapshot'],
+ type: info.type,
+ isCreate: true,
+ submitText: gettext('Take Snapshot'),
+ running: running,
+ });
+ win.show();
+ },
+ },
+ {
+ text: gettext('Backup now'),
+ iconCls: 'fa fa-fw fa-floppy-o',
+ disabled: !!caps.vms['VM.Snapshot'] && snapshotFeature,
+ handler: function () {
+ var win = Ext.create('PVE.window.Backup', {
+ nodename: info.node,
+ vmid: info.vmid,
+ vmtype: info.type,
+ vmname: info.name,
+ });
+ win.show();
+ },
+ },
+ { xtype: 'menuseparator' },
{
text: gettext('Console'),
iconCls: 'fa fa-fw fa-terminal',
--git a/www/manager6/qemu/CmdMenu.js b/www/manager6/qemu/CmdMenu.js
index 5fa9407d..5f9ba740 100644
--- a/www/manager6/qemu/CmdMenu.js
+++ b/www/manager6/qemu/CmdMenu.js
@@ -31,6 +31,17 @@ Ext.define('PVE.qemu.CmdMenu', {
});
};
+ let snapshotFeature;
+
+ Proxmox.Utils.API2Request({
+ url: `/nodes/${info.node}/${info.type}/${info.vmid}/feature`,
+ params: { feature: 'snapshot' },
+ method: 'GET',
+ success: function (response, _) {
+ snapshotFeature = !!response.result.data.hasFeature;
+ },
+ });
+
let caps = Ext.state.Manager.get('GuiCap');
let standalone = PVE.Utils.isStandaloneNode();
@@ -162,6 +173,40 @@ Ext.define('PVE.qemu.CmdMenu', {
},
},
{ xtype: 'menuseparator' },
+ {
+ text: gettext('Take Snapshot'),
+ iconCls: 'fa fa-fw fa-history',
+ disabled: !!caps.vms['VM.Snapshot'] && snapshotFeature,
+ handler: function () {
+
+ let win = Ext.create('PVE.window.Snapshot', {
+ nodename: info.node,
+ vmid: info.vmid,
+ vmname: info.name,
+ viewonly: !caps.vms['VM.Snapshot'],
+ type: info.type,
+ isCreate: true,
+ submitText: gettext('Take Snapshot'),
+ running: running,
+ });
+ win.show();
+ },
+ },
+ {
+ text: gettext('Backup now'),
+ iconCls: 'fa fa-fw fa-floppy-o',
+ disabled: !!caps.vms['VM.Snapshot'] && snapshotFeature,
+ handler: function () {
+ var win = Ext.create('PVE.window.Backup', {
+ nodename: info.node,
+ vmid: info.vmid,
+ vmtype: info.type,
+ vmname: info.name,
+ });
+ win.show();
+ },
+ },
+ { xtype: 'menuseparator' },
{
text: gettext('Console'),
iconCls: 'fa fa-fw fa-terminal',
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
prev parent reply other threads:[~2025-09-30 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-30 13:01 [pve-devel] [PATCH pve-manager 0/2] " Nicolas Frey
2025-09-30 13:01 ` [pve-devel] [PATCH pve-manager 1/2] ui: remove excess '}' at the end of snapshot subject Nicolas Frey
2025-09-30 13:01 ` Nicolas Frey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250930130134.101875-3-n.frey@proxmox.com \
--to=n.frey@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox