Add rdp menu option.

This commit is contained in:
SimonFair
2024-06-02 15:06:58 +01:00
parent b35ce11344
commit b2916424be
5 changed files with 24 additions and 1 deletions

View File

@@ -83,10 +83,13 @@ function ajaxVMDispatchWebUI(params, spin){
}
},'json');
}
function addVMContext(name, uuid, template, state, vmrcurl, vmrcprotocol, log, fstype="QEMU",console="web",usage=false,webui=""){
function addVMContext(name, uuid, template, state, vmrcurl, vmrcprotocol, log, fstype="QEMU",consolein="web;no",usage=false,webui=""){
var opts = [];
var path = location.pathname;
var x = path.indexOf("?");
var consolesplit = consolein.split(";");
var console = consolesplit[0];
var rdpopt = consolesplit[1];
if (x!=-1) path = path.substring(0,x);
if (vmrcurl !== "" && state == "running") {
if (console == "web" || console == "both") {
@@ -108,6 +111,12 @@ function addVMContext(name, uuid, template, state, vmrcurl, vmrcprotocol, log, f
ajaxVMDispatchWebUI({action:"domain-openWebUI", uuid:uuid, vmrcurl:webui}, "loadlist") ;
}});
}
if (rdpopt == "yes") {
opts.push({text:_("VM Windows RDP"), icon:"fa-desktop", action:function(e) {
e.preventDefault();
ajaxVMDispatchconsoleRV({action:"domain-consoleRDP", uuid:uuid, vmrcurl:vmrcurl}, "loadlist") ;
}});
}
opts.push({divider:true});
}
context.settings({right:false,above:false});