mirror of
https://github.com/unraid/webgui.git
synced 2026-01-13 21:20:01 -06:00
VM Manager GUI Changes,
This commit is contained in:
@@ -73,6 +73,7 @@ foreach ($vms as $vm) {
|
||||
if ($vncport > 0) {
|
||||
$wsport = $lv->domain_get_ws_port($res);
|
||||
$vnc = autov('/plugins/dynamix.vm.manager/vnc.html',true).'&autoconnect=true&host=' . $_SERVER['HTTP_HOST'] . '&port=&path=/wsproxy/' . $wsport . '/';
|
||||
$spice = autov('/plugins/dynamix.vm.manager/spice.html',true).'&autoconnect=true&host=' . $_SERVER['HTTP_HOST'] . '&port='.$vncport ;
|
||||
$graphics = 'VNC:'.$vncport;
|
||||
} elseif ($vncport == -1) {
|
||||
$graphics = 'VNC:auto';
|
||||
@@ -92,7 +93,7 @@ foreach ($vms as $vm) {
|
||||
$graphics = str_replace("\n", "<br>", trim($graphics));
|
||||
}
|
||||
unset($dom);
|
||||
$menu = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s')\"", addslashes($vm),addslashes($uuid),addslashes($template),$state,addslashes($vnc),addslashes($log));
|
||||
$menu = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s')\"", addslashes($vm),addslashes($uuid),addslashes($template),$state,addslashes($vnc),addslashes($spice),addslashes($log));
|
||||
$kvm[] = "kvm.push({id:'$uuid',state:'$state'});";
|
||||
switch ($state) {
|
||||
case 'running':
|
||||
|
||||
@@ -14,7 +14,7 @@ function ajaxVMDispatch(params, spin){
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function addVMContext(name, uuid, template, state, vncurl, log){
|
||||
function addVMContext(name, uuid, template, state, vncurl, spicecurl, log){
|
||||
var opts = [];
|
||||
var path = location.pathname;
|
||||
var x = path.indexOf("?");
|
||||
@@ -26,6 +26,13 @@ function addVMContext(name, uuid, template, state, vncurl, log){
|
||||
}});
|
||||
opts.push({divider:true});
|
||||
}
|
||||
if (spicecurl !== "") {
|
||||
opts.push({text:_("Spice Remote"), icon:"fa-desktop", action:function(e) {
|
||||
e.preventDefault();
|
||||
window.open(spicecurl, '_blank', 'scrollbars=yes,resizable=yes');
|
||||
}});
|
||||
opts.push({divider:true});
|
||||
}
|
||||
if (state == "running") {
|
||||
opts.push({text:_("Stop"), icon:"fa-stop", action:function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user