diff --git a/emhttp/plugins/dynamix.vm.manager/VMMachines.page b/emhttp/plugins/dynamix.vm.manager/VMMachines.page index 1fbdbf65e..92addef7c 100644 --- a/emhttp/plugins/dynamix.vm.manager/VMMachines.page +++ b/emhttp/plugins/dynamix.vm.manager/VMMachines.page @@ -486,7 +486,7 @@ $(function() { - + diff --git a/emhttp/plugins/dynamix.vm.manager/VMTemplates.page b/emhttp/plugins/dynamix.vm.manager/VMTemplates.page index 3ef5bf021..aa9987861 100644 --- a/emhttp/plugins/dynamix.vm.manager/VMTemplates.page +++ b/emhttp/plugins/dynamix.vm.manager/VMTemplates.page @@ -38,6 +38,16 @@ Markdown="false" if (strpos($strName,"User-") === false) $user = ""; else $user = ' class="user"'; ?> + +"> +"> +"> + + + + + +
> @@ -46,7 +56,9 @@ Markdown="false"

-
+
+ +

\ No newline at end of file +i.export{display:none;font-size:1.8rem;position:left;margin-left:1px} + + +
+
+ +
+
+
_(Save File Name)_:
+
+
_(Save Path)_:
+
+
+
+ +
+
+
_(File for import)_:
+
+
+
+ + + true]; break; +case 'vm-template-save': + $template = $_REQUEST['template']; + $name = $_REQUEST['name']; + $replace = $_REQUEST['replace']; + + if (is_file($name) && $replace == "no"){ + $arrResponse = ['success' => false, 'error' => _("File exists.")]; + } else { + $error = file_put_contents($name,json_encode($template)); + if ($error !== false) $arrResponse = ['success' => true]; + else { + $arrResponse = ['success' => false, 'error' => _("File write failed.")]; + } + } + break; + +case 'vm-template-import': + $template = $_REQUEST['template']; + $name = $_REQUEST['name']; + $replace = $_REQUEST['replace']; + $templateslocation = "/boot/config/plugins/dynamix.vm.manager/savedtemplates.json"; + + if ($template="*file") { + $template=json_decode(file_get_contents($name)); + } + + $namepathinfo = pathinfo($name); + $template_name = $namepathinfo['filename']; + + if (is_file($templateslocation)){ + $ut = json_decode(file_get_contents($templateslocation),true) ; + if (isset($ut[$template_name]) && $replace == "no"){ + $arrResponse = ['success' => false, 'error' => _("Template exists.")]; + } else { + $ut[$template_name] = $template; + $error = file_put_contents($templateslocation,json_encode($ut,JSON_PRETTY_PRINT));; + if ($error !== false) $arrResponse = ['success' => true]; + else { + $arrResponse = ['success' => false, 'error' => _("Tempalte file write failed.")]; + } + } + } + break; + default: $arrResponse = ['error' => _('Unknown action')." '$action'"]; break; diff --git a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php index 042a17ae0..5a0a1784c 100644 --- a/emhttp/plugins/dynamix.vm.manager/include/libvirt.php +++ b/emhttp/plugins/dynamix.vm.manager/include/libvirt.php @@ -847,6 +847,19 @@ if (($gpu['copypaste'] == "yes") && ($strProtocol == "spice")) $vmrcmousemode = "" ; else $vmrcmousemode = "" ; if ($strProtocol == "spice") $virtualaudio = "spice" ; else $virtualaudio = "none" ; + $strEGLHeadless = ""; + $strAccel3d =""; + if ($strModelType == "virtio3d") { + $strModelType = "virtio"; + if (!isset($gpu['render'])) $gpu['render'] = "auto"; + if ($gpu['render'] == "auto") { + $strEGLHeadless = ''; + $strAccel3d = ""; + } else { + $strEGLHeadless = ''; + $strAccel3d =""; + }} + $vmrc = " @@ -854,8 +867,11 @@ $vmrcmousemode + $strEGLHeadless