diff --git a/emhttp/languages/en_US/helptext.txt b/emhttp/languages/en_US/helptext.txt index b878ec9af..3227592d3 100644 --- a/emhttp/languages/en_US/helptext.txt +++ b/emhttp/languages/en_US/helptext.txt @@ -1680,6 +1680,10 @@ For setting the console options to show on context menus. Web will show only inb Virtual Manager Remote Viewer will only show the Remote Viewer option. Both will show both Web and Remote Viewer. :end +:vms_rdpopt_help: +Adds option to menu to start RDP. RDP file is downloaded. You need to set browser to open when ready. +:end + :vms_usage_help: Show metrics for CPU both guest and host percentage, memory, disk io and network io. :end diff --git a/emhttp/plugins/dynamix.vm.manager/VMSettings.page b/emhttp/plugins/dynamix.vm.manager/VMSettings.page index 99d2501a3..afa172038 100644 --- a/emhttp/plugins/dynamix.vm.manager/VMSettings.page +++ b/emhttp/plugins/dynamix.vm.manager/VMSettings.page @@ -183,6 +183,14 @@ _(Console Options)_: :vms_console_help: +_(Show RDP menu option)_: +: + +:vms_rdpopt_help: + _(Show VM Usage)_: : + + +
+
+

Specify a URL that for menu to start. Substution variables are +
[IP] IP address, this will take the first IP on the VM. Guest Agent must be installed for this to work. +
[PORT:XX] Port Number in XX. +
[VMNAME] VM Name will have spaces replaced with - +

+
+
+ diff --git a/emhttp/plugins/dynamix/include/DashboardApps.php b/emhttp/plugins/dynamix/include/DashboardApps.php index 73a4c83a1..36edf47a9 100644 --- a/emhttp/plugins/dynamix/include/DashboardApps.php +++ b/emhttp/plugins/dynamix/include/DashboardApps.php @@ -119,7 +119,9 @@ if ($_POST['vms']) { if (empty($template)) $template = 'Custom'; $log = (is_file("/var/log/libvirt/qemu/$vm.log") ? "libvirt/qemu/$vm.log" : ''); if (!isset($domain_cfg["CONSOLE"])) $vmrcconsole = "web" ; else $vmrcconsole = $domain_cfg["CONSOLE"] ; - $menu = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s','%s','%s')\"", addslashes($vm), addslashes($uuid), addslashes($template), $state, addslashes($vmrcurl), strtoupper($vmrcprotocol), addslashes($log),addslashes($fstype), $vmrcconsole); + if (!isset($domain_cfg["RDPOPT"])) $vmrcconsole .= ";no" ; else $vmrcconsole .= ";".$domain_cfg["RDPOPT"] ; + $WebUI = html_entity_decode($arrConfig["template"]["webui"]); + $menu = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')\"", addslashes($vm), addslashes($uuid), addslashes($template), $state, addslashes($vmrcurl), strtoupper($vmrcprotocol), addslashes($log),addslashes($fstype), $vmrcconsole,false,addslashes(str_replace('"',"'",$WebUI))); $icon = $lv->domain_get_icon_url($res); switch ($state) { case 'running': @@ -144,7 +146,7 @@ if ($_POST['vms']) { echo "$image$vm
"._($status)."
"; if ($state == "running") { #Build VM Usage array. - $menuusage = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')\"", addslashes($vm), addslashes($uuid), addslashes($template), $state, addslashes($vmrcurl), strtoupper($vmrcprotocol), addslashes($log),addslashes($fstype), $vmrcconsole,true); + $menuusage = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')\"", addslashes($vm), addslashes($uuid), addslashes($template), $state, addslashes($vmrcurl), strtoupper($vmrcprotocol), addslashes($log),addslashes($fstype), $vmrcconsole,true,addslashes(str_replace('"',"'",$WebUI))); $vmusagehtml[] = "$image$vm
"._($status)."
"; $vmusagehtml[] = "

"._("Loading")."...."; $vmusagehtml[] = "
"._("Loading")."...."; diff --git a/emhttp/plugins/dynamix/include/Helpers.php b/emhttp/plugins/dynamix/include/Helpers.php index 15c536538..1788b97bf 100644 --- a/emhttp/plugins/dynamix/include/Helpers.php +++ b/emhttp/plugins/dynamix/include/Helpers.php @@ -285,12 +285,14 @@ function my_mkdir($dirname,$permissions = 0777,$recursive = false,$own = "nobody $parent = str_replace('/mnt/user/', "/mnt/$realdisk/", $parent); } } - $fstype = trim(shell_exec(" stat -f -c '%T' $parent")); + $fstype = trim(shell_exec(" stat -f -c '%T' $parent")); $rtncode = false; switch ($fstype) { case "zfs": $zfsdataset = trim(shell_exec("zfs list -H -o name $parent")) ; - $zfsdataset .= str_replace($parent,"",$dirname); + if (strpos($zfsdataset,'/') !== false) $zfsdataset .= str_replace($parent,"",$dirname); else { + $zfsdataset .= str_replace("/mnt/$zfsdataset","",$dirname); + } if ($recursive) $rtncode=exec("zfs create -p \"$zfsdataset\"");else $rtncode=exec("zfs create \"$zfsdataset\""); if (!$rtncode) mkdir($dirname, $permissions, $recursive); else chmod($zfsdataset,$permissions); break;