]> git.proxmox.com Git - pve-manager.git/blob - www/manager/qemu/SendKeyMenu.js
disable animation of charts on load
[pve-manager.git] / www / manager / qemu / SendKeyMenu.js
1 Ext.define('PVE.qemu.SendKeyMenu', {
2 extend: 'Ext.button.Button',
3 alias: ['widget.pveQemuSendKeyMenu'],
4
5 initComponent : function() {
6 var me = this;
7
8 if (!me.nodename) {
9 throw "no node name specified";
10 }
11
12 if (!me.vmid) {
13 throw "no VM ID specified";
14 }
15
16 var sendKey = function(key) {
17 PVE.Utils.API2Request({
18 params: { key: key },
19 url: '/nodes/' + me.nodename + '/qemu/' + me.vmid + "/sendkey",
20 method: 'PUT',
21 waitMsgTarget: me,
22 failure: function(response, opts) {
23 Ext.Msg.alert('Error', response.htmlStatus);
24 }
25 });
26 };
27
28 Ext.apply(me, {
29 text: 'SendKey',
30 menu: new Ext.menu.Menu({
31 height: 200,
32 items: [
33 {
34 text: 'Tab', handler: function() {
35 sendKey('tab');
36 }
37 },
38 {
39 text: 'Ctrl-Alt-Delete', handler: function() {
40 sendKey('ctrl-alt-delete');
41 }
42 },
43 {
44 text: 'Ctrl-Alt-Backspace', handler: function() {
45 sendKey('ctrl-alt-backspace');
46 }
47 },
48 {
49 text: 'Ctrl-Alt-F1', handler: function() {
50 sendKey('ctrl-alt-f1');
51 }
52 },
53 {
54 text: 'Ctrl-Alt-F2', handler: function() {
55 sendKey('ctrl-alt-f2');
56 }
57 },
58 {
59 text: 'Ctrl-Alt-F3', handler: function() {
60 sendKey('ctrl-alt-f3');
61 }
62 },
63 {
64 text: 'Ctrl-Alt-F4', handler: function() {
65 sendKey('ctrl-alt-f4');
66 }
67 },
68 {
69 text: 'Ctrl-Alt-F5', handler: function() {
70 sendKey('ctrl-alt-f5');
71 }
72 },
73 {
74 text: 'Ctrl-Alt-F6', handler: function() {
75 sendKey('ctrl-alt-f6');
76 }
77 },
78 {
79 text: 'Ctrl-Alt-F7', handler: function() {
80 sendKey('ctrl-alt-f7');
81 }
82 },
83 {
84 text: 'Ctrl-Alt-F8', handler: function() {
85 sendKey('ctrl-alt-f8');
86 }
87 },
88 {
89 text: 'Ctrl-Alt-F9', handler: function() {
90 sendKey('ctrl-alt-f9');
91 }
92 },
93 {
94 text: 'Ctrl-Alt-F10', handler: function() {
95 sendKey('ctrl-alt-f10');
96 }
97 },
98 {
99 text: 'Ctrl-Alt-F11', handler: function() {
100 sendKey('ctrl-alt-f11');
101 }
102 },
103 {
104 text: 'Ctrl-Alt-F12', handler: function() {
105 sendKey('ctrl-alt-f12');
106 }
107 }
108 ]
109 })
110 });
111
112 me.callParent();
113 }
114 });