to right-click menu and dropdown menu

Signed-off-by: Oguz Bektas <o.bek...@proxmox.com>
---
 www/manager6/lxc/CmdMenu.js | 16 ++++++++++++++++
 www/manager6/lxc/Config.js  |  9 +++++++++
 2 files changed, 25 insertions(+)

diff --git a/www/manager6/lxc/CmdMenu.js b/www/manager6/lxc/CmdMenu.js
index 579b2585..e922546a 100644
--- a/www/manager6/lxc/CmdMenu.js
+++ b/www/manager6/lxc/CmdMenu.js
@@ -112,6 +112,22 @@ Ext.define('PVE.lxc.CmdMenu', {
                    });
                }
            },
+           {
+               text: gettext('Reboot'),
+               iconCls: 'fa fa-fw fa-refresh',
+               disabled: stopped,
+               tooltip: Ext.String.format(gettext('Reboot {0}'), 'CT'),
+               handler: function() {
+                   var msg = Proxmox.Utils.format_task_description('vzreboot', 
vmid);
+                   Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
+                       if (btn !== 'yes') {
+                           return;
+                       }
+
+                       vm_command("reboot");
+                   });
+               }
+           },
            {
                xtype: 'menuseparator',
                hidden: standalone || !caps.vms['VM.Migrate']
diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index bfe58040..60c440bb 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -71,6 +71,15 @@ Ext.define('PVE.lxc.Config', {
                        vm_command("stop");
                    },
                    iconCls: 'fa fa-stop'
+               },{
+                   text: gettext('Reboot'),
+                   disabled: !caps.vms['VM.PowerMgmt'],
+                   confirmMsg: 
Proxmox.Utils.format_task_description('vzreboot', vmid),
+                   tooltip: Ext.String.format(gettext('Reboot {0}'), 'CT'),
+                   handler: function() {
+                       vm_command("reboot");
+                   },
+                   iconCls: 'fa fa-refresh'
                }]
            },
            iconCls: 'fa fa-power-off'
-- 
2.20.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to