]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/node/CmdMenu.js
1 Ext
.define('PVE.node.CmdMenu', {
2 extend
: 'Ext.menu.Menu',
9 text
: gettext('Create VM'),
11 iconCls
: 'fa fa-desktop',
13 Ext
.create('PVE.qemu.CreateWizard', {
14 nodename
: this.up('menu').nodename
,
20 text
: gettext('Create CT'),
22 iconCls
: 'fa fa-cube',
24 Ext
.create('PVE.lxc.CreateWizard', {
25 nodename
: this.up('menu').nodename
,
30 { xtype
: 'menuseparator' },
32 text
: gettext('Bulk Start'),
34 iconCls
: 'fa fa-fw fa-play',
36 Ext
.create('PVE.window.BulkAction', {
37 nodename
: this.up('menu').nodename
,
38 title
: gettext('Bulk Start'),
39 btnText
: gettext('Start'),
46 text
: gettext('Bulk Shutdown'),
48 iconCls
: 'fa fa-fw fa-stop',
50 Ext
.create('PVE.window.BulkAction', {
51 nodename
: this.up('menu').nodename
,
52 title
: gettext('Bulk Shutdown'),
53 btnText
: gettext('Shutdown'),
60 text
: gettext('Bulk Migrate'),
61 itemId
: 'bulkmigrate',
62 iconCls
: 'fa fa-fw fa-send-o',
64 Ext
.create('PVE.window.BulkAction', {
65 nodename
: this.up('menu').nodename
,
66 title
: gettext('Bulk Migrate'),
67 btnText
: gettext('Migrate'),
73 { xtype
: 'menuseparator' },
75 text
: gettext('Shell'),
77 iconCls
: 'fa fa-fw fa-terminal',
79 let nodename
= this.up('menu').nodename
;
80 PVE
.Utils
.openDefaultConsoleWindow(true, 'shell', undefined, nodename
, undefined);
83 { xtype
: 'menuseparator' },
85 text
: gettext('Wake-on-LAN'),
87 iconCls
: 'fa fa-fw fa-power-off',
89 let nodename
= this.up('menu').nodename
;
90 Proxmox
.Utils
.API2Request({
91 url
: `/nodes/${nodename}/wakeonlan`,
93 failure
: (response
, opts
) => Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
),
94 success: function(response
, opts
) {
98 msg
: Ext
.String
.format(
99 gettext("Wake on LAN packet send for '{0}': '{1}'"),
101 response
.result
.data
,
110 initComponent: function() {
114 throw 'no nodename specified';
117 me
.title
= gettext('Node') + " '" + me
.nodename
+ "'";
120 let caps
= Ext
.state
.Manager
.get('GuiCap');
122 if (!caps
.vms
['VM.Allocate']) {
123 me
.getComponent('createct').setDisabled(true);
124 me
.getComponent('createvm').setDisabled(true);
126 if (!caps
.nodes
['Sys.PowerMgmt']) {
127 me
.getComponent('bulkstart').setDisabled(true);
128 me
.getComponent('bulkstop').setDisabled(true);
129 me
.getComponent('bulkmigrate').setDisabled(true);
130 me
.getComponent('wakeonlan').setDisabled(true);
132 if (!caps
.nodes
['Sys.Console']) {
133 me
.getComponent('shell').setDisabled(true);
135 if (me
.pveSelNode
.data
.running
) {
136 me
.getComponent('wakeonlan').setDisabled(true);