mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 22:13:24 +00:00
open vm console on doubleclick in tree
with this patch you can open the console of a guest with a simple doubleclick in the tree Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
6cc8cfb361
commit
e31294433f
@ -1195,6 +1195,27 @@ Ext.define('PVE.Utils', { statics: {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
openTreeConsole: function(tree, record, item, index, e) {
|
||||||
|
e.stopEvent();
|
||||||
|
var nodename = record.data.node;
|
||||||
|
var vmid = record.data.vmid;
|
||||||
|
var vmname = record.data.name;
|
||||||
|
if (record.data.type === 'qemu' && !record.data.template) {
|
||||||
|
PVE.Utils.API2Request({
|
||||||
|
url: '/nodes/' + nodename + '/qemu/' + vmid + '/status/current',
|
||||||
|
failure: function(response, opts) {
|
||||||
|
Ext.Msg.alert('Error', response.htmlStatus);
|
||||||
|
},
|
||||||
|
success: function(response, opts) {
|
||||||
|
var allowSpice = response.result.data.spice;
|
||||||
|
PVE.Utils.openDefaultConsoleWindow(allowSpice, 'kvm', vmid, nodename, vmname);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (record.data.type === 'lxc' && !record.data.template) {
|
||||||
|
PVE.Utils.openDefaultConsoleWindow(true, 'lxc', vmid, nodename, vmname);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
createCmdMenu: function(v, record, item, index, event) {
|
createCmdMenu: function(v, record, item, index, event) {
|
||||||
event.stopEvent();
|
event.stopEvent();
|
||||||
if (!(v instanceof Ext.tree.View)) {
|
if (!(v instanceof Ext.tree.View)) {
|
||||||
|
@ -387,7 +387,8 @@ Ext.define('PVE.tree.ResourceTree', {
|
|||||||
var allow = me.allowSelection;
|
var allow = me.allowSelection;
|
||||||
me.allowSelection = true;
|
me.allowSelection = true;
|
||||||
return allow;
|
return allow;
|
||||||
}
|
},
|
||||||
|
itemdblclick: PVE.Utils.openTreeConsole
|
||||||
},
|
},
|
||||||
setViewFilter: function(view) {
|
setViewFilter: function(view) {
|
||||||
me.viewFilter = view;
|
me.viewFilter = view;
|
||||||
|
Loading…
Reference in New Issue
Block a user