diff --git a/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php b/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php index 69ed7c9f8..0c8a7e56f 100644 --- a/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php +++ b/emhttp/plugins/dynamix.apcupsd/include/UPSstatus.php @@ -12,7 +12,8 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); + // add translations $_SERVER['REQUEST_URI'] = 'settings'; require_once "$docroot/webGui/include/Translations.php"; diff --git a/emhttp/plugins/dynamix.docker.manager/AddContainer.page b/emhttp/plugins/dynamix.docker.manager/AddContainer.page index 9afe0734d..e0d6efbbe 100644 --- a/emhttp/plugins/dynamix.docker.manager/AddContainer.page +++ b/emhttp/plugins/dynamix.docker.manager/AddContainer.page @@ -5,7 +5,7 @@ Markdown="false" /dev/null\ --- -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; $user_prefs = $dockerManPaths['user-prefs']; diff --git a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php index 79f67266f..35b49e0a3 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php +++ b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php @@ -1,7 +1,7 @@ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; -libxml_use_internal_errors(true); - require_once "$docroot/webGui/include/Helpers.php"; extract(parse_plugin_cfg('dynamix',true)); @@ -374,6 +372,13 @@ function getVal(el, name) { } } +function dialogStyle() { + $('.ui-dialog-titlebar-close').css({'display':'none'}); + $('.ui-dialog-title').css({'text-align':'center','width':'100%','font-size':'1.8rem'}); + $('.ui-dialog-content').css({'padding-top':'15px','vertical-align':'bottom'}); + $('.ui-button-text').css({'padding':'0px 5px'}); +} + function addConfigPopup() { var title = "_(Add Configuration)_"; var popup = $("#dialogAddConfig"); @@ -391,8 +396,9 @@ function addConfigPopup() { // Start Dialog section popup.dialog({ title: title, + height: 'auto', + width: 900, resizable: false, - width: 800, modal: true, buttons: { "_(Add)_": function() { @@ -425,10 +431,7 @@ function addConfigPopup() { } } }); - $('.ui-dialog-titlebar-close').css({'display':'none'}); - $('.ui-dialog-title').css({'text-align':'center','width':'100%','font-size':'1.8rem'}); - $('.ui-dialog-content').css({'padding-top':'15px','vertical-align':'bottom'}); - $('.ui-button-text').css({'padding':'0px 5px'}); + dialogStyle(); } function editConfigPopup(num,disabled) { @@ -462,8 +465,9 @@ function editConfigPopup(num,disabled) { popup.find(".switch-button-background").css("margin-top", "6px"); popup.dialog({ title: title, + height: 'auto', + width: 900, resizable: false, - width: 800, modal: true, buttons: { "_(Save)_": function() { @@ -505,10 +509,7 @@ function editConfigPopup(num,disabled) { } } }); - $('.ui-dialog-titlebar-close').css({'display':'none'}); - $('.ui-dialog-title').css({'text-align':'center','width':'100%','font-size':'1.8rem'}); - $('.ui-dialog-content').css({'padding-top':'15px','vertical-align':'bottom'}); - $('.ui-button-text').css({'padding':'0px 5px'}); + dialogStyle(); $('.desc_readmore').readmore({maxHeight:10}); } diff --git a/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php b/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php index 8fc260c18..fa5923f8e 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php +++ b/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php @@ -1,7 +1,7 @@ -libxml_use_internal_errors(true); # Suppress any warnings from xml errors. - -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/Helpers.php"; require_once "$docroot/webGui/include/Wrappers.php"; @@ -56,8 +53,8 @@ if (file_exists($docker_cfgfile) && exec("grep -Pom1 '_{$port}(_[0-9]+)?=' $dock exec("sed -ri 's/_(BR0|BOND0|ETH0)(_[0-9]+)?=/_{$port}\\2=/' $docker_cfgfile"); } -$defaults = @parse_ini_file("$docroot/plugins/dynamix.docker.manager/default.cfg") ?: []; -$dockercfg = array_replace_recursive($defaults, @parse_ini_file($docker_cfgfile) ?: []); +$defaults = (array)@parse_ini_file("$docroot/plugins/dynamix.docker.manager/default.cfg"); +$dockercfg = array_replace_recursive($defaults, (array)@parse_ini_file($docker_cfgfile)); function var_split($item, $i=0) { return array_pad(explode(' ',$item),$i+1,'')[$i]; diff --git a/emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php b/emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php index 0dc11bb93..400898dd6 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php +++ b/emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php @@ -1,7 +1,7 @@ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Helpers.php"; require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; @@ -34,7 +33,7 @@ if (!$containers && !$images) { } if (file_exists($user_prefs)) { - $prefs = @parse_ini_file($user_prefs) ?: []; + $prefs = (array)@parse_ini_file($user_prefs); $sort = []; foreach ($containers as $ct) $sort[] = array_search($ct['Name'],$prefs); array_multisort($sort,SORT_NUMERIC,$containers); @@ -46,7 +45,7 @@ $allInfo = $DockerTemplates->getAllInfo(); $docker = []; $null = '0.0.0.0'; -$autostart = @file($autostart_file,FILE_IGNORE_NEW_LINES) ?: []; +$autostart = (array)@file($autostart_file,FILE_IGNORE_NEW_LINES); $names = array_map('var_split',$autostart); function my_lang_time($text) { diff --git a/emhttp/plugins/dynamix.docker.manager/include/DockerUpdate.php b/emhttp/plugins/dynamix.docker.manager/include/DockerUpdate.php index 3b4647624..ee0233318 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/DockerUpdate.php +++ b/emhttp/plugins/dynamix.docker.manager/include/DockerUpdate.php @@ -1,7 +1,7 @@ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; $ncsi = exec("wget --spider --no-check-certificate -nv -T10 -t1 https://www.msftncsi.com/ncsi.txt 2>&1|grep -o 'OK'")=='OK'; diff --git a/emhttp/plugins/dynamix.docker.manager/include/Events.php b/emhttp/plugins/dynamix.docker.manager/include/Events.php index 1ac064cbd..a16c1d418 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/Events.php +++ b/emhttp/plugins/dynamix.docker.manager/include/Events.php @@ -1,7 +1,7 @@ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Secure.php"; require_once "$docroot/webGui/include/Wrappers.php"; require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; diff --git a/emhttp/plugins/dynamix.docker.manager/include/Helpers.php b/emhttp/plugins/dynamix.docker.manager/include/Helpers.php index 920996dc7..820acef3d 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/Helpers.php +++ b/emhttp/plugins/dynamix.docker.manager/include/Helpers.php @@ -1,7 +1,7 @@ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; $autostart_file = $dockerManPaths['autostart-file']; @@ -25,7 +25,7 @@ case 'autostart': $container = urldecode(($_POST['container'])); $wait = $_POST['wait']; $item = rtrim("$container $wait"); - $autostart = @file($autostart_file, FILE_IGNORE_NEW_LINES) ?: []; + $autostart = (array)@file($autostart_file, FILE_IGNORE_NEW_LINES); $key = array_search($item, $autostart); if ($_POST['auto']=='true') { if ($key===false) $autostart[] = $item; @@ -48,7 +48,7 @@ case 'wait': $container = urldecode(($_POST['container'])); $wait = $_POST['wait']; $item = rtrim("$container $wait"); - $autostart = file($autostart_file, FILE_IGNORE_NEW_LINES) ?: []; + $autostart = (array)@file($autostart_file, FILE_IGNORE_NEW_LINES); $names = array_map('var_split', $autostart); $autostart[array_search($container,$names)] = $item; file_put_contents($autostart_file, implode("\n", $autostart)."\n"); diff --git a/emhttp/plugins/dynamix.docker.manager/include/UserPrefs.php b/emhttp/plugins/dynamix.docker.manager/include/UserPrefs.php index cb3e091ee..3a2ea460b 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/UserPrefs.php +++ b/emhttp/plugins/dynamix.docker.manager/include/UserPrefs.php @@ -1,7 +1,7 @@ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; $autostart_file = $dockerManPaths['autostart-file']; diff --git a/emhttp/plugins/dynamix.docker.manager/javascript/docker.js b/emhttp/plugins/dynamix.docker.manager/javascript/docker.js index 680118fd7..a1a3a0d20 100644 --- a/emhttp/plugins/dynamix.docker.manager/javascript/docker.js +++ b/emhttp/plugins/dynamix.docker.manager/javascript/docker.js @@ -61,15 +61,15 @@ function popupWithIframe(title, cmd, reload, func) { $('#iframe-popup').dialog({ autoOpen:true, title:title, + height: 600, + width: 900, draggable:true, - width: Math.min(Math.max(window.innerWidth/2,900),1600), - height: Math.max(window.innerHeight*3/5,600), resizable:true, modal:true, - open:function(ev, ui) { + open:function(ev, ui){ $('#myIframe').attr('src', cmd); }, - close:function(event, ui) { + close:function(event, ui){ if (reload && !$('#myIframe').contents().find('#canvas').length) { if (func) setTimeout(func+'()',0); else location = window.location.href; } else { @@ -77,13 +77,13 @@ function popupWithIframe(title, cmd, reload, func) { } } }); - $(".ui-dialog .ui-dialog-titlebar").addClass('menu'); - $('.ui-dialog .ui-dialog-titlebar-close').text('X').prop('title',_('Close')); - $(".ui-dialog .ui-dialog-title").css({'text-align':'center','width':'100%'}); - $(".ui-dialog .ui-dialog-content").css({'padding-top':'15px','vertical-align':'bottom'}); + $('.ui-dialog-titlebar-close').css({'display':'none'}); + $('.ui-dialog-title').css({'text-align':'center','width':'100%','font-size':'1.8rem'}); + $('.ui-dialog-content').css({'padding-top':'15px','vertical-align':'bottom'}); + $('.ui-button-text').css({'padding':'0px 5px'}); } function execUpContainer(container) { - var title = _('Updating the container')+': '+container; + var title = _('Updating the container TEST')+': '+container; var cmd = '/plugins/dynamix.docker.manager/include/CreateDocker.php?updateContainer=true&ct[]='+encodeURIComponent(container); popupWithIframe(title, cmd, true, 'loadlist'); } diff --git a/emhttp/plugins/dynamix.docker.manager/scripts/container_size b/emhttp/plugins/dynamix.docker.manager/scripts/container_size index ee43b699b..cbc8b0a39 100755 --- a/emhttp/plugins/dynamix.docker.manager/scripts/container_size +++ b/emhttp/plugins/dynamix.docker.manager/scripts/container_size @@ -12,8 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; extract(parse_plugin_cfg('dynamix',true)); diff --git a/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate b/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate index da6ae3e08..8f5482095 100755 --- a/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate +++ b/emhttp/plugins/dynamix.docker.manager/scripts/dockerupdate @@ -1,8 +1,8 @@ #!/usr/bin/php -q -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; extract(parse_plugin_cfg('dynamix', true)); @@ -45,7 +44,7 @@ if (!isset($check)) { echo " Done."; } else { $notify = "$docroot/webGui/scripts/notify"; - $var = @parse_ini_file("/var/local/emhttp/var.ini") ?: []; + $var = (array)@parse_ini_file("/var/local/emhttp/var.ini"); $server = strtoupper(_var($var,'NAME','tower')); $output = _var($notify,'docker_notify'); $info = $DockerTemplates->getAllInfo(true); diff --git a/emhttp/plugins/dynamix.docker.manager/scripts/rebuild_container b/emhttp/plugins/dynamix.docker.manager/scripts/rebuild_container index 533670ee8..55bc7205c 100755 --- a/emhttp/plugins/dynamix.docker.manager/scripts/rebuild_container +++ b/emhttp/plugins/dynamix.docker.manager/scripts/rebuild_container @@ -12,7 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php"; $DockerClient = new DockerClient(); diff --git a/emhttp/plugins/dynamix.docker.manager/scripts/update_container b/emhttp/plugins/dynamix.docker.manager/scripts/update_container index f37897abd..12588f0bb 100755 --- a/emhttp/plugins/dynamix.docker.manager/scripts/update_container +++ b/emhttp/plugins/dynamix.docker.manager/scripts/update_container @@ -12,8 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; extract(parse_plugin_cfg('dynamix',true)); diff --git a/emhttp/plugins/dynamix.my.servers/data/server-state.php b/emhttp/plugins/dynamix.my.servers/data/server-state.php index 6ed4af1f9..9c2afa414 100644 --- a/emhttp/plugins/dynamix.my.servers/data/server-state.php +++ b/emhttp/plugins/dynamix.my.servers/data/server-state.php @@ -1,5 +1,5 @@ - diff --git a/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php b/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php index a3a92ba2a..9742e7bbc 100644 --- a/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php +++ b/emhttp/plugins/dynamix.plugin.manager/include/Downgrade.php @@ -11,8 +11,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; require_once "$docroot/webGui/include/Secure.php"; diff --git a/emhttp/plugins/dynamix.plugin.manager/include/ShowChanges.php b/emhttp/plugins/dynamix.plugin.manager/include/ShowChanges.php index 9a74a136c..3500f5e32 100644 --- a/emhttp/plugins/dynamix.plugin.manager/include/ShowChanges.php +++ b/emhttp/plugins/dynamix.plugin.manager/include/ShowChanges.php @@ -11,8 +11,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; extract(parse_plugin_cfg('dynamix',true)); diff --git a/emhttp/plugins/dynamix.plugin.manager/include/ShowPlugins.php b/emhttp/plugins/dynamix.plugin.manager/include/ShowPlugins.php index 60a81355d..2d9b9bea5 100644 --- a/emhttp/plugins/dynamix.plugin.manager/include/ShowPlugins.php +++ b/emhttp/plugins/dynamix.plugin.manager/include/ShowPlugins.php @@ -11,8 +11,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Helpers.php"; require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; diff --git a/emhttp/plugins/dynamix.plugin.manager/post-hooks/post_plugin_checks b/emhttp/plugins/dynamix.plugin.manager/post-hooks/post_plugin_checks index 272a30b3f..d681d3df3 100755 --- a/emhttp/plugins/dynamix.plugin.manager/post-hooks/post_plugin_checks +++ b/emhttp/plugins/dynamix.plugin.manager/post-hooks/post_plugin_checks @@ -12,7 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: "/usr/local/emhttp"; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; function readJson($file) { diff --git a/emhttp/plugins/dynamix.plugin.manager/pre-hooks/pre_plugin_checks b/emhttp/plugins/dynamix.plugin.manager/pre-hooks/pre_plugin_checks index 78f266f47..de0ffc911 100755 --- a/emhttp/plugins/dynamix.plugin.manager/pre-hooks/pre_plugin_checks +++ b/emhttp/plugins/dynamix.plugin.manager/pre-hooks/pre_plugin_checks @@ -12,7 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: "/usr/local/emhttp"; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; $type = $argv[1]??''; // plugin or language diff --git a/emhttp/plugins/dynamix.plugin.manager/scripts/PluginAPI.php b/emhttp/plugins/dynamix.plugin.manager/scripts/PluginAPI.php index 1915ab237..66b457448 100644 --- a/emhttp/plugins/dynamix.plugin.manager/scripts/PluginAPI.php +++ b/emhttp/plugins/dynamix.plugin.manager/scripts/PluginAPI.php @@ -10,12 +10,13 @@ * all copies or substantial portions of the Software. */ -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); +require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; +require_once "$docroot/plugins/dynamix/include/Secure.php"; + //add translations $_SERVER['REQUEST_URI'] = "plugins"; require_once "$docroot/plugins/dynamix/include/Translations.php"; -require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; -require_once "$docroot/plugins/dynamix/include/Secure.php"; function download_url($url, $path = "") { $ch = curl_init(); @@ -39,21 +40,17 @@ switch ($_POST['action']) { case 'checkPlugin': $options = $_POST['options'] ?? ''; $plugin = $options['plugin'] ?? ''; - $name = unbundle($options['name'] ?? $plugin); $file = "/boot/config/plugins/$plugin"; $file = realpath($file)==$file ? $file : ""; - if ( ! $plugin || ! file_exists($file) ) { echo json_encode(["updateAvailable"=>false]); break; } - exec("mkdir -p /tmp/plugins"); @unlink("/tmp/plugins/$plugin"); $url = plugin("pluginURL","/boot/config/plugins/$plugin"); download_url($url,"/tmp/plugins/$plugin"); - $changes = plugin("changes","/tmp/plugins/$plugin"); $alerts = plugin("alert","/tmp/plugins/$plugin"); $version = plugin("version","/tmp/plugins/$plugin"); @@ -69,7 +66,6 @@ switch ($_POST['action']) { } else { @unlink('/tmp/plugins/my_alerts.txt'); } - $update = false; if ( strcmp($version,$installedVersion) > 0 ) { $unraid = parse_ini_file("/etc/unraid-version"); @@ -77,17 +73,14 @@ switch ($_POST['action']) { } $updateMessage = sprintf(_("%s: An update is available."),$name); $linkMessage = sprintf(_("Click here to install version %s"),$version); - echo json_encode(["updateAvailable"=>$update, "version"=>$version, "min"=>$min, "alert"=>$alerts, "changes"=>$changes, "installedVersion"=>$installedVersion, "updateMessage"=>$updateMessage, "linkMessage"=>$linkMessage]); break; case 'addRebootNotice': $message = htmlspecialchars(trim($_POST['message'])); - if ( ! $message ) break; - - $existing = @file("/tmp/reboot_notifications",FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: []; + if (!$message) break; + $existing = (array)@file("/tmp/reboot_notifications",FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $existing[] = $message; - file_put_contents("/tmp/reboot_notifications",implode("\n",array_unique($existing))); break; diff --git a/emhttp/plugins/dynamix.plugin.manager/scripts/checkall b/emhttp/plugins/dynamix.plugin.manager/scripts/checkall index eee96871d..7c46a8ed5 100755 --- a/emhttp/plugins/dynamix.plugin.manager/scripts/checkall +++ b/emhttp/plugins/dynamix.plugin.manager/scripts/checkall @@ -12,8 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; extract(parse_plugin_cfg('dynamix',true)); diff --git a/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck b/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck index 6290cbe1e..93e8265fe 100755 --- a/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck +++ b/emhttp/plugins/dynamix.plugin.manager/scripts/languagecheck @@ -12,8 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; extract(parse_plugin_cfg('dynamix', true)); @@ -23,7 +22,7 @@ $_SERVER['REQUEST_URI'] = "scripts"; $login_locale = _var($display,'locale'); require_once "$docroot/webGui/include/Translations.php"; -$var = @parse_ini_file('/var/local/emhttp/var.ini') ?: []; +$var = (array)@parse_ini_file('/var/local/emhttp/var.ini'); function apos($text) { // So that "'" doesn't show up in email diff --git a/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck b/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck index 763b2915c..6eb1acec0 100755 --- a/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck +++ b/emhttp/plugins/dynamix.plugin.manager/scripts/plugincheck @@ -12,11 +12,9 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; - extract(parse_plugin_cfg('dynamix',true)); // Multi-language support @@ -24,7 +22,7 @@ $_SERVER['REQUEST_URI'] = "scripts"; $login_locale = _var($display,'locale'); require_once "$docroot/webGui/include/Translations.php"; -$var = @parse_ini_file('/var/local/emhttp/var.ini') ?: []; +$var = (array)@parse_ini_file('/var/local/emhttp/var.ini'); function apos($text) { // So that "'" doesn't show up in email diff --git a/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges b/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges index b64ba83d4..1f0ffbb7a 100755 --- a/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges +++ b/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges @@ -12,8 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; extract(parse_plugin_cfg('dynamix',true)); diff --git a/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck b/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck index 710c0e496..d4f87f0aa 100755 --- a/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck +++ b/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck @@ -12,8 +12,7 @@ */ ?> -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; - +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/webGui/include/Wrappers.php"; require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"; @@ -24,7 +23,7 @@ if (!function_exists('_')) { extract(parse_plugin_cfg('dynamix', true)); -$var = @parse_ini_file('/var/local/emhttp/var.ini') ?: []; +$var = (array)@parse_ini_file('/var/local/emhttp/var.ini'); $script = "$docroot/webGui/scripts/notify"; $server = strtoupper(_var($var,'NAME','server')); $output = _var($notify,'plugin'); diff --git a/emhttp/plugins/dynamix.vm.manager/AddVM.page b/emhttp/plugins/dynamix.vm.manager/AddVM.page index 7db9d73fd..2e099b6b5 100644 --- a/emhttp/plugins/dynamix.vm.manager/AddVM.page +++ b/emhttp/plugins/dynamix.vm.manager/AddVM.page @@ -6,7 +6,7 @@ Markdown="false" -$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; +$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'); require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php"; $cpus = cpu_list(); @@ -143,36 +143,26 @@ function dialogStyle() { $('.ui-button-text').css({'padding':'0px 5px'}); } function getisoimageboth(uuid,dev,bus,file,dev2,bus2,file2){ - var root = "=$domain_cfg["MEDIADIR"]?>"; - var match = ".iso"; var box = $("#dialogWindow"); box.html($("#templateISOboth").html()); - box.find('#target').attr('data-pickroot',root).attr('data-picktop',root).attr('data-pickmatch',match).attr('value',file).fileTreeAttach(null,null,function(path){ - var bits = path.substr(1).split('/'); - var auto = bits.length>3 ? '' : share; - box.find('#target').val(path+auto).change(); + box.find('#target').attr('value',file).fileTreeAttach(null,null,function(path){ + box.find('#target').val(path).change(); }); - box.find('#target2').attr('data-pickroot',root).attr('data-picktop',root).attr('data-pickmatch',match).attr('value',file2).fileTreeAttach(null,null,function(path){ - var bits = path.substr(1).split('/'); - var auto = bits.length>3 ? '' : share; - box.find('#target2').val(path+auto).change(); + box.find('#target2').attr('value',file2).fileTreeAttach(null,null,function(path){ + box.find('#target2').val(path).change(); }); box.dialog({ title: "_(Select ISOs for CDROMs)_", - height: 600, - width: 600, + height: 530, + width: 900, resizable: false, modal: true, buttons: { "_(Update)_": function(){ var target = box.find('#target'); - if (target.length) { - target = target.val(); - } else target = ''; + if (target.length) target = target.val(); else target = ''; var target2 = box.find('#target2'); - if (target2.length) { - target2 = target2.val(); - } else target2 = ''; + if (target2.length) target2 = target2.val(); else target2 = ''; box.find('#target').prop('disabled',true); box.find('#target2').prop('disabled',true); ajaxVMDispatch({action:"change-media-both", uuid:uuid, cdrom:"", dev:dev, bus:bus, file:target, dev2:dev2, bus2:bus2, file2:target2}, "loadlist"); @@ -186,28 +176,21 @@ function getisoimageboth(uuid,dev,bus,file,dev2,bus2,file2){ dialogStyle(); } function getisoimage(uuid,dev,bus,file){ - var root = "=$domain_cfg["MEDIADIR"]?>"; - var match = ".iso"; var box = $("#dialogWindow"); box.html($("#templateISO").html()); - box.find('#target').attr('data-pickroot',root).attr('data-picktop',root).attr('data-pickmatch',match).fileTreeAttach(null,null,function(path){ - var bits = path.substr(1).split('/'); - var auto = bits.length>3 ? '' : share; - box.find('#target').val(path+auto).change(); + box.find('#target').attr('value',file).fileTreeAttach(null,null,function(path){ + box.find('#target').val(path).change(); }); box.dialog({ title: "_(Select ISO)_", - height: 600, - width: 600, + height: 530, + width: 900, resizable: false, modal: true, buttons: { "_(Insert)_": function(){ var target = box.find('#target'); - if (target.length) { - target = target.val(); - if (!target ) {errorTarget(); return;} - } else target = ''; + if (target.length) target = target.val(); else target = ''; box.find('#target').prop('disabled',true); ajaxVMDispatch({action:"change-media", uuid:uuid, cdrom:"", dev:dev, bus:bus, file:target}, "loadlist"); box.dialog('close'); @@ -228,7 +211,7 @@ function VMClone(uuid, name){ document.getElementById("Overwrite").checked = true; box.dialog({ title: "_(VM Clone)_", - height: 330, + height: 'auto', width: 600, resizable: false, modal: true, @@ -275,7 +258,7 @@ function selectsnapshot(uuid, name ,snaps, opt, getlist,state){ document.getElementById("targetsnapfspc").checked = true; box.dialog({ title: optiontext, - height: 330, + height: 'auto', width: 600, resizable: false, modal: true, @@ -348,7 +331,7 @@ function selectblock(uuid, name, snaps, opt, getlist, state){ } box.dialog({ title: optiontext, - height: 330, + height: 'auto', width: 600, resizable: false, modal: true, @@ -488,17 +471,20 @@ $(function() {
-
Unraid Share
Set tag and path to match the selected Unraid share.
@@ -918,8 +919,8 @@
Unraid Mount tag
Specify the mount tag that you will use for mounting the VirtFS share inside the VM. See this page for how to do this on a Linux-based guest: http://wiki.qemu.org/Documentation/9psetup
- For Windows additional software needs to be installed: https://virtio-fs.gitlab.io/howto-windows.html +
+ For Windows additional software needs to be installed: https://virtio-fs.gitlab.io/howto-windows.html
Additional devices can be added/removed by clicking the symbols to the left.
@@ -939,12 +940,12 @@ _(Unraid Share)_: - +
Virtual video protocol VNC/SPICE
- If you wish to assign a protocol type, specify one here.
+ If you wish to assign a protocol type, specify one here.
@@ -1092,7 +1093,7 @@
Virtual auto port
- Set it you want to specify a manual port for VNC or Spice. VNC needs two ports where Spice only requires one. Leave as auto yes for the system to set.
+ Set it you want to specify a manual port for VNC or Spice. VNC needs two ports where Spice only requires one. Leave as auto yes for the system to set.
@@ -1196,13 +1197,13 @@ if ( $arrConfig['nic'] == false) { - $arrConfig['nic']['0'] = + $arrConfig['nic']['0'] = [ 'network' => $domain_bridge, 'mac' => "", 'model' => 'virtio-net' ] ; - } + } foreach ($arrConfig['nic'] as $i => $arrNic) { $strLabel = ($i > 0) ? appendOrdinalSuffix($i + 1) : ''; @@ -1326,7 +1327,7 @@
| - | _(Select)_  _(Optional)_  _(Boot Order)_ | _(Select)_  _(Optional)_  _(Boot Order)_ | ||||
| _(USB Devices)_: |
@@ -1336,7 +1337,7 @@
foreach($arrVMUSBs as $i => $arrDev) {
?>
@@ -1357,7 +1358,7 @@
| style="width: 50px;" name="nic[=$i?>][boot]" title="_(Boot order)_" value="=$arrNic['boot']?>" > | -