diff --git a/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php b/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php
index 8279f31c4..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];
@@ -353,7 +350,6 @@ class DockerTemplates {
if (!$imgUrl) $imgUrl = $tmpIconUrl;
if (!$imgUrl || trim($imgUrl) == "/plugins/dynamix.docker.manager/images/question.png") return '';
- $imageName = $contName ?: $name;
$iconRAM = sprintf('%s/%s-%s.png', $dockerManPaths['images-ram'], $contName, 'icon');
$icon = sprintf('%s/%s-%s.png', $dockerManPaths['images'], $contName, 'icon');
@@ -367,8 +363,8 @@ class DockerTemplates {
if (!is_file($icon) && is_file($iconRAM)) {
@copy($iconRAM,$icon);
}
- if ( !is_file($iconRAM) ) {
- exec("logger -t webGUI -- \"$imageName: Could not download icon $imgUrl\"");
+ if (!is_file($iconRAM)) {
+ exec("logger -t webGUI -- \"$contName: Could not download icon $imgUrl\"");
}
return (is_file($iconRAM)) ? str_replace($docroot, '', $iconRAM) : '';
diff --git a/emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php b/emhttp/plugins/dynamix.docker.manager/include/DockerContainers.php
index 7692b4d95..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) {
@@ -108,7 +107,7 @@ foreach ($containers as $ct) {
}
echo "
"._('Container ID').": $id
";
- if ($ct['BaseImage']) echo "
".htmlspecialchars(${ct['BaseImage']})."
";
+ if ($ct['BaseImage']) echo "
".htmlspecialchars($ct['BaseImage'])."
";
echo _('By').": ";
$registry = $info['registry'];
[$author,$version] = my_explode(':',$ct['Image']);
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 39f5fd31f..a1a3a0d20 100644
--- a/emhttp/plugins/dynamix.docker.manager/javascript/docker.js
+++ b/emhttp/plugins/dynamix.docker.manager/javascript/docker.js
@@ -61,17 +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,
- show:{effect:'fade', duration:250},
- hide:{effect:'fade', duration:250},
- 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 {
@@ -79,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 5e2f60a28..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));
@@ -22,7 +21,7 @@ $_SERVER['REQUEST_URI'] = 'docker';
$login_locale = _var($display,'locale');
require_once "$docroot/webGui/include/Translations.php";
-$unit = ['B','kB','MB','GB','TB','PB','EB','ZB','YB'];
+$units = ['B','kB','MB','GB','TB','PB','EB','ZB','YB'];
$list = [];
function write(...$messages){
@@ -40,13 +39,13 @@ function write(...$messages){
curl_close($com);
}
function autoscale($value) {
- global $unit;
- $size = count($unit);
+ global $units;
+ $size = count($units);
$base = $value ? floor(log($value, 1000)) : 0;
if ($base>=$size) $base = $size-1;
$value /= pow(1000, $base);
$decimals = $base ? ($value>=100 ? 0 : ($value>=10 ? 1 : (round($value*100)%100===0 ? 0 : 2))) : 0;
- return number_format($value, $decimals, '.', $value>9999 ? ',' : '').' '.$unit[$base];
+ return number_format($value, $decimals, '.', $value>9999 ? ',' : '').' '.$units[$base];
}
function align($text, $w=25) {
return $text.str_repeat(' ',$w-min(strlen($text),$w-1));
@@ -55,9 +54,9 @@ function gap($text) {
return preg_replace('/([kMGTPEZY]?B)$/'," $1",$text);
}
function byteval($data) {
- global $unit;
+ global $units;
[$value,$base] = explode(' ',gap($data));
- return $value*pow(1000,array_search($base,$unit));
+ return $value*pow(1000,array_search($base,$units));
}
exec("docker ps -sa --format='{{.Names}}|{{.Size}}'",$container);
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.docker.manager/sheets/AddContainer-azure.css b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-azure.css
new file mode 100644
index 000000000..87419de0b
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-azure.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-black.css b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-black.css
new file mode 100644
index 000000000..5bfde958d
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-black.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-gray.css b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-gray.css
new file mode 100644
index 000000000..5bfde958d
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-gray.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-white.css b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-white.css
new file mode 100644
index 000000000..87419de0b
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer-white.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer.css b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer.css
new file mode 100644
index 000000000..e6518eb71
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/AddContainer.css
@@ -0,0 +1,9 @@
+.noshow,.advanced{display:none}
+.required:after{content:" *";color:#E80000}
+span.boxed{display:inline-block;line-height:normal;white-space:normal;width:60%}
+span.cpu,label.checkbox{display:inline-block;width:32px}
+span.ct{display:inline-block;width:230px}
+span.net{display:inline-block;width:120px}
+span.ip{display:inline-block;width:160px}
+dl,dt,dd{line-height:normal!important}
+input.setting_input{margin-right:50px}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/DockerContainers.css b/emhttp/plugins/dynamix.docker.manager/sheets/DockerContainers.css
new file mode 100644
index 000000000..f57f754f0
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/DockerContainers.css
@@ -0,0 +1,12 @@
+.basic{display:block}
+.advanced{display:none;white-space:nowrap}
+.log{cursor:zoom-in}
+.exec{cursor:pointer}
+table#docker_containers{text-align:left}
+th.five{width:5%}
+th.nine{width:9%}
+th.load{width:140px}
+input.wait{width:24px;margin:0 4px;padding:0 5px;border:none;box-shadow:none;background-color:transparent}
+table tbody td{line-height:normal}
+i.mover{margin-right:8px;display:none}
+#resetsort{margin-left:12px;display:inline-block;width:32px}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-azure.css b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-azure.css
new file mode 100644
index 000000000..d60555212
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-azure.css
@@ -0,0 +1,2 @@
+.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
+span.disabled{color:#B0B0B0}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-black.css b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-black.css
new file mode 100644
index 000000000..97dd4a600
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-black.css
@@ -0,0 +1,2 @@
+.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
+span.disabled{color:#404040}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-gray.css b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-gray.css
new file mode 100644
index 000000000..97dd4a600
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-gray.css
@@ -0,0 +1,2 @@
+.fileTree{background:#1c1c1c;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
+span.disabled{color:#404040}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-white.css b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-white.css
new file mode 100644
index 000000000..d60555212
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings-white.css
@@ -0,0 +1,2 @@
+.fileTree{background:#f2f2f2;width:300px;max-height:150px;overflow-y:scroll;overflow-x:hidden;position:absolute;z-index:100;display:none}
+span.disabled{color:#B0B0B0}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings.css b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings.css
new file mode 100644
index 000000000..b4db05070
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/DockerSettings.css
@@ -0,0 +1,17 @@
+.errortext{color:#EF3D47;display:none;margin-left:20px}
+.basic{display:inline-block}
+.advanced{display:none}
+select.mask{min-width:0;margin:0 10px 0 4px}
+select.net{min-width:0;margin:0 4px 0 2px}
+select option.hide{display:none}
+input.ip4{width:100px;margin:0 4px 0 1px}
+input.ip6{width:140px;margin:0 4px}
+input.gw4{width:100px;margin:0 4px 0 1px}
+input.gw6{width:160px;margin:0 4px}
+input.pool6{width:40px;margin:0 4px 0 1px}
+span.net{margin-left:4px;margin-right:2px}
+span.ip4{display:inline-block;width:260px}
+span.ip6{display:inline-block;width:310px}
+span.gw4{display:inline-block;width:200px}
+span.gw6{display:inline-block;width:270px}
+span.nonexist{margin-left:20px}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-azure.css b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-azure.css
new file mode 100644
index 000000000..87419de0b
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-azure.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-black.css b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-black.css
new file mode 100644
index 000000000..5bfde958d
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-black.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-gray.css b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-gray.css
new file mode 100644
index 000000000..5bfde958d
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-gray.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#1c1c1c}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-white.css b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-white.css
new file mode 100644
index 000000000..87419de0b
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer-white.css
@@ -0,0 +1 @@
+.fileTree{width:240px;max-height:200px;overflow-y:scroll;overflow-x:hidden;position:absolute;display:none;background:#f2f2f2}
diff --git a/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer.css b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer.css
new file mode 100644
index 000000000..e6518eb71
--- /dev/null
+++ b/emhttp/plugins/dynamix.docker.manager/sheets/UpdateContainer.css
@@ -0,0 +1,9 @@
+.noshow,.advanced{display:none}
+.required:after{content:" *";color:#E80000}
+span.boxed{display:inline-block;line-height:normal;white-space:normal;width:60%}
+span.cpu,label.checkbox{display:inline-block;width:32px}
+span.ct{display:inline-block;width:230px}
+span.net{display:inline-block;width:120px}
+span.ip{display:inline-block;width:160px}
+dl,dt,dd{line-height:normal!important}
+input.setting_input{margin-right:50px}
diff --git a/emhttp/plugins/dynamix.docker.manager/styles/style-azure.css b/emhttp/plugins/dynamix.docker.manager/styles/style-azure.css
index af78778ad..260009398 100644
--- a/emhttp/plugins/dynamix.docker.manager/styles/style-azure.css
+++ b/emhttp/plugins/dynamix.docker.manager/styles/style-azure.css
@@ -1,62 +1,14 @@
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{
- font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{
- color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)
-}
-.ui-dropdownchecklist .ui-state-default{
- background:#f2f2f2;
- border:none;
- box-shadow:none;
- outline:none;
- cursor:pointer;
- height:2.2rem;
- line-height:2.2rem;
-}
-.ui-dropdownchecklist-group{
- font-weight:normal;
- font-style:italic;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector{
- border:1px solid #1c1c1c;
- display:inline-block;
- cursor:pointer;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector-wrapper{
- vertical-align:middle;
- font-size:0;
-}
-.ui-widget-header{
- border:none;
- background:#e3e3e3;
- color:#1c1c1c;
- font-weight:bold;
-}
-.ui-widget-content{
- border:1px solid #1c1c1c;
- background:#f2f2f2;
- color:#1c1c1c;
-
-.ui-state-active{
- background:#e8e8e8;
-}
-.ui-dropdownchecklist-dropcontainer{
- background:#f2f2f2;
- border:1px solid #1c1c1c;
-}
-.ui-state-disabled{
- color:#1c1c1c;border-color:#a2a2a2;background:#e8e8e8;opacity:0.5;
-}
-.ui-dropdownchecklist-indent{
- padding-left:7px;
-}
-.ui-dropdownchecklist-text{
- color:#1c1c1c;
- font-size:1.3rem;
-}
-.ui-dropdownchecklist .ui-widget-content .ui-state-default{
- background:#f2f2f2;
- border:0px;
-}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
+.ui-dropdownchecklist .ui-state-default{background:#f2f2f2;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
+.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector{border:1px solid #1c1c1c;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
+.ui-widget-header{border:none;background:#e3e3e3;color:#1c1c1c;font-weight:bold}
+.ui-widget-content{border:1px solid #1c1c1c;background:#f2f2f2;color:#1c1c1c}
+.ui-state-active{background:#e8e8e8}
+.ui-dropdownchecklist-dropcontainer{background:#f2f2f2;border:1px solid #1c1c1c}
+.ui-state-disabled{color:#1c1c1c;border-color:#a2a2a2;background:#e8e8e8;opacity:0.5}
+.ui-dropdownchecklist-indent{padding-left:7px}
+.ui-dropdownchecklist-text{color:#1c1c1c;font-size:1.3rem}
+.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#f2f2f2;border:0px}
diff --git a/emhttp/plugins/dynamix.docker.manager/styles/style-black.css b/emhttp/plugins/dynamix.docker.manager/styles/style-black.css
index 4757973a7..064aa4307 100644
--- a/emhttp/plugins/dynamix.docker.manager/styles/style-black.css
+++ b/emhttp/plugins/dynamix.docker.manager/styles/style-black.css
@@ -1,62 +1,14 @@
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{
- font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{
- color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)
-}
-.ui-dropdownchecklist .ui-state-default{
- background:#1c1c1c;
- border:none;
- box-shadow:none;
- outline:none;
- cursor:pointer;
- height:2.2rem;
- line-height:2.2rem;
-}
-.ui-dropdownchecklist-group{
- font-weight:normal;
- font-style:italic;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector{
- border:1px solid #e5e5e5;
- display:inline-block;
- cursor:pointer;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector-wrapper{
- vertical-align:middle;
- font-size:0;
-}
-.ui-widget-header{
- border:none;
- background:#2b2b2b;
- color:#f2f2f2;
- font-weight:bold;
-}
-.ui-widget-content{
- border:1px solid #e5e5e5;
- background:#1c1c1c;
- color:#f2f2f2;
-
-.ui-state-active{
- background:#262626;
-}
-.ui-dropdownchecklist-dropcontainer{
- background:#1c1c1c;
- border:1px solid #e5e5e5;
-}
-.ui-state-disabled{
- color:#f2f2f2;border-color:#6c6c6c;background:#262626;opacity:0.5;
-}
-.ui-dropdownchecklist-indent{
- padding-left:7px;
-}
-.ui-dropdownchecklist-text{
- color:#f2f2f2;
- font-size:1.3rem;
-}
-.ui-dropdownchecklist .ui-widget-content .ui-state-default{
- background:#1c1c1c;
- border:0px;
-}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
+.ui-dropdownchecklist .ui-state-default{background:#1c1c1c;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
+.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector{border:1px solid #e5e5e5;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
+.ui-widget-header{border:none;background:#2b2b2b;color:#f2f2f2;font-weight:bold}
+.ui-widget-content{border:1px solid #e5e5e5;background:#1c1c1c;color:#f2f2f2}
+.ui-state-active{background:#262626}
+.ui-dropdownchecklist-dropcontainer{background:#1c1c1c;border:1px solid #e5e5e5}
+.ui-state-disabled{color:#f2f2f2;border-color:#6c6c6c;background:#262626;opacity:0.5}
+.ui-dropdownchecklist-indent{padding-left:7px}
+.ui-dropdownchecklist-text{color:#f2f2f2;font-size:1.3rem}
+.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#1c1c1c;border:0px}
diff --git a/emhttp/plugins/dynamix.docker.manager/styles/style-gray.css b/emhttp/plugins/dynamix.docker.manager/styles/style-gray.css
index 4757973a7..064aa4307 100644
--- a/emhttp/plugins/dynamix.docker.manager/styles/style-gray.css
+++ b/emhttp/plugins/dynamix.docker.manager/styles/style-gray.css
@@ -1,62 +1,14 @@
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{
- font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{
- color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)
-}
-.ui-dropdownchecklist .ui-state-default{
- background:#1c1c1c;
- border:none;
- box-shadow:none;
- outline:none;
- cursor:pointer;
- height:2.2rem;
- line-height:2.2rem;
-}
-.ui-dropdownchecklist-group{
- font-weight:normal;
- font-style:italic;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector{
- border:1px solid #e5e5e5;
- display:inline-block;
- cursor:pointer;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector-wrapper{
- vertical-align:middle;
- font-size:0;
-}
-.ui-widget-header{
- border:none;
- background:#2b2b2b;
- color:#f2f2f2;
- font-weight:bold;
-}
-.ui-widget-content{
- border:1px solid #e5e5e5;
- background:#1c1c1c;
- color:#f2f2f2;
-
-.ui-state-active{
- background:#262626;
-}
-.ui-dropdownchecklist-dropcontainer{
- background:#1c1c1c;
- border:1px solid #e5e5e5;
-}
-.ui-state-disabled{
- color:#f2f2f2;border-color:#6c6c6c;background:#262626;opacity:0.5;
-}
-.ui-dropdownchecklist-indent{
- padding-left:7px;
-}
-.ui-dropdownchecklist-text{
- color:#f2f2f2;
- font-size:1.3rem;
-}
-.ui-dropdownchecklist .ui-widget-content .ui-state-default{
- background:#1c1c1c;
- border:0px;
-}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
+.ui-dropdownchecklist .ui-state-default{background:#1c1c1c;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
+.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector{border:1px solid #e5e5e5;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
+.ui-widget-header{border:none;background:#2b2b2b;color:#f2f2f2;font-weight:bold}
+.ui-widget-content{border:1px solid #e5e5e5;background:#1c1c1c;color:#f2f2f2}
+.ui-state-active{background:#262626}
+.ui-dropdownchecklist-dropcontainer{background:#1c1c1c;border:1px solid #e5e5e5}
+.ui-state-disabled{color:#f2f2f2;border-color:#6c6c6c;background:#262626;opacity:0.5}
+.ui-dropdownchecklist-indent{padding-left:7px}
+.ui-dropdownchecklist-text{color:#f2f2f2;font-size:1.3rem}
+.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#1c1c1c;border:0px}
diff --git a/emhttp/plugins/dynamix.docker.manager/styles/style-white.css b/emhttp/plugins/dynamix.docker.manager/styles/style-white.css
index af78778ad..260009398 100644
--- a/emhttp/plugins/dynamix.docker.manager/styles/style-white.css
+++ b/emhttp/plugins/dynamix.docker.manager/styles/style-white.css
@@ -1,62 +1,14 @@
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{
- font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%
-}
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{
- color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)
-}
-.ui-dropdownchecklist .ui-state-default{
- background:#f2f2f2;
- border:none;
- box-shadow:none;
- outline:none;
- cursor:pointer;
- height:2.2rem;
- line-height:2.2rem;
-}
-.ui-dropdownchecklist-group{
- font-weight:normal;
- font-style:italic;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector{
- border:1px solid #1c1c1c;
- display:inline-block;
- cursor:pointer;
- padding:1px 9px 1px 8px;
-}
-.ui-dropdownchecklist-selector-wrapper{
- vertical-align:middle;
- font-size:0;
-}
-.ui-widget-header{
- border:none;
- background:#e3e3e3;
- color:#1c1c1c;
- font-weight:bold;
-}
-.ui-widget-content{
- border:1px solid #1c1c1c;
- background:#f2f2f2;
- color:#1c1c1c;
-
-.ui-state-active{
- background:#e8e8e8;
-}
-.ui-dropdownchecklist-dropcontainer{
- background:#f2f2f2;
- border:1px solid #1c1c1c;
-}
-.ui-state-disabled{
- color:#1c1c1c;border-color:#a2a2a2;background:#e8e8e8;opacity:0.5;
-}
-.ui-dropdownchecklist-indent{
- padding-left:7px;
-}
-.ui-dropdownchecklist-text{
- color:#1c1c1c;
- font-size:1.3rem;
-}
-.ui-dropdownchecklist .ui-widget-content .ui-state-default{
- background:#f2f2f2;
- border:0px;
-}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button{font-family:clear-sans;font-size:1.1rem;font-weight:bold;letter-spacing:2px;text-transform:uppercase;margin:10px 12px 10px 0;padding:9px 18px;text-decoration:none;white-space:nowrap;cursor:pointer;outline:none;border-radius:4px;border:0;color:#ff8c2f;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 0 no-repeat,-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#e22828),to(#e22828)) 0 100% no-repeat,-webkit-gradient(linear,left bottom,left top,from(#ff8c2f),to(#ff8c2f)) 100% 100% no-repeat;background:linear-gradient(90deg,#e22828 0,#ff8c2f) 0 0 no-repeat,linear-gradient(90deg,#e22828 0,#ff8c2f) 0 100% no-repeat,linear-gradient(0deg,#e22828 0,#e22828) 0 100% no-repeat,linear-gradient(0deg,#ff8c2f 0,#ff8c2f) 100% 100% no-repeat;background-size:100% 2px,100% 2px,2px 100%,2px 100%}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover{color:#f2f2f2;background:-webkit-gradient(linear,left top,right top,from(#e22828),to(#ff8c2f));background:linear-gradient(90deg,#e22828 0,#ff8c2f)}
+.ui-dropdownchecklist .ui-state-default{background:#f2f2f2;border:none;box-shadow:none;outline:none;cursor:pointer;height:2.2rem;line-height:2.2rem}
+.ui-dropdownchecklist-group{font-weight:normal;font-style:italic;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector{border:1px solid #1c1c1c;display:inline-block;cursor:pointer;padding:1px 9px 1px 8px}
+.ui-dropdownchecklist-selector-wrapper{vertical-align:middle;font-size:0}
+.ui-widget-header{border:none;background:#e3e3e3;color:#1c1c1c;font-weight:bold}
+.ui-widget-content{border:1px solid #1c1c1c;background:#f2f2f2;color:#1c1c1c}
+.ui-state-active{background:#e8e8e8}
+.ui-dropdownchecklist-dropcontainer{background:#f2f2f2;border:1px solid #1c1c1c}
+.ui-state-disabled{color:#1c1c1c;border-color:#a2a2a2;background:#e8e8e8;opacity:0.5}
+.ui-dropdownchecklist-indent{padding-left:7px}
+.ui-dropdownchecklist-text{color:#1c1c1c;font-size:1.3rem}
+.ui-dropdownchecklist .ui-widget-content .ui-state-default{background:#f2f2f2;border:0px}
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 @@
- $var['csrf_token'],
- '#file' => $mys_cfg,
- '#section' => 'remote'
- ];
- foreach($orig['remote'] as $key => $value) {
- $fields_mys_remote[$key] = $value;
- }
- update($url, http_build_query($fields_mys_remote));
- }
- /*
- // write [wizard] section to myservers.cfg
- if(!empty($orig['wizard'])) {
- $fields_mys_wizard = [
- 'csrf_token' => $var['csrf_token'],
- '#file' => $mys_cfg,
- '#section' => 'wizard'
- ];
- foreach($orig['wizard'] as $key => $value) {
- $fields_mys_wizard[$key] = $value;
- }
- update($url, http_build_query($fields_mys_wizard));
- }
- */
- // remove [remote] section from dynamix.cfg
- if(!empty($orig['remote'])) {
- $fields_dyn_remote = [
- 'csrf_token' => $var['csrf_token'],
- '#file' => $dyn_cfg,
- '#section' => 'remote',
- '#cleanup' => 'true'
- ];
- foreach($orig['remote'] as $key => $value) {
- $fields_dyn_remote[$key] = '';
- }
- update($url, http_build_query($fields_dyn_remote));
- }
- // remove [wizard] section from dynamix.cfg
- if(!empty($orig['wizard'])) {
- $fields_dyn_wizard = [
- 'csrf_token' => $var['csrf_token'],
- '#file' => $dyn_cfg,
- '#section' => 'wizard',
- '#cleanup' => 'true'
- ];
- foreach($orig['wizard'] as $key => $value) {
- $fields_dyn_wizard[$key] = '';
- }
- update($url, http_build_query($fields_dyn_wizard));
- }
- // remove [remote] and [wizard] section headings from dyn_cfg file
- $oldtext = file_get_contents($dyn_cfg);
- $newtext = preg_replace ('/\[(remote|wizard)\]\n/', '', $oldtext);
- if (strcmp($oldtext, $newtext) !== 0) {
- file_put_contents($dyn_cfg, $newtext);
- }
-}
-if (!file_exists($mys_cfg)) touch($mys_cfg);
-
-?>
diff --git a/emhttp/plugins/dynamix.my.servers/sheets/Registration.css b/emhttp/plugins/dynamix.my.servers/sheets/Registration.css
new file mode 100644
index 000000000..2e70df6ad
--- /dev/null
+++ b/emhttp/plugins/dynamix.my.servers/sheets/Registration.css
@@ -0,0 +1,4 @@
+span.thanks{padding-left:12px;color:#6FA239;font-weight:bold;}
+span.thanks.red{color:#F0000C;}
+div.device{padding:0 12px;font-weight:normal;font-style:italic;}
+div.remark{padding:0 12px;text-align:justify;}
diff --git a/emhttp/plugins/dynamix.plugin.manager/PluginHelpers.page b/emhttp/plugins/dynamix.plugin.manager/PluginHelpers.page
index 26af81523..551e1a89d 100644
--- a/emhttp/plugins/dynamix.plugin.manager/PluginHelpers.page
+++ b/emhttp/plugins/dynamix.plugin.manager/PluginHelpers.page
@@ -13,14 +13,6 @@ Link='nav-user'
* all copies or substantial portions of the Software.
*/
?>
-
@@ -166,45 +136,36 @@ function changemedia(uuid,dev,bus,file) {
if (file === "--select") getisoimage(uuid,dev,bus,file);
if (file === "--eject") ajaxVMDispatch({action:"change-media", uuid:uuid , cdrom:"" , dev:dev , bus:bus , file:file}, "loadlist");
}
+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 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('#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();
- });
- var height = 100;
-
+ box.find('#target').attr('value',file).fileTreeAttach(null,null,function(path){
+ box.find('#target').val(path).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",
+ title: "_(Select ISOs for CDROMs)_",
+ height: 530,
+ width: 900,
resizable: false,
- width: 600,
- height: 300,
modal: true,
- show: {effect:'fade', duration:250},
- hide: {effect:'fade', duration:250},
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");
+ ajaxVMDispatch({action:"change-media-both", uuid:uuid, cdrom:"", dev:dev, bus:bus, file:target, dev2:dev2, bus2:bus2, file2:target2}, "loadlist");
box.dialog('close');
},
"_(Cancel)_": function(){
@@ -215,34 +176,23 @@ 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();
- });
- var height = 100;
+ box.find('#target').attr('value',file).fileTreeAttach(null,null,function(path){
+ box.find('#target').val(path).change();
+ });
box.dialog({
- title: "Select ISO",
+ title: "_(Select ISO)_",
+ height: 530,
+ width: 900,
resizable: false,
- width: 600,
- height: 300,
modal: true,
- show: {effect:'fade', duration:250},
- hide: {effect:'fade', duration:250},
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");
+ ajaxVMDispatch({action:"change-media", uuid:uuid, cdrom:"", dev:dev, bus:bus, file:target}, "loadlist");
box.dialog('close');
},
"_(Cancel)_": function(){
@@ -253,44 +203,32 @@ function getisoimage(uuid,dev,bus,file){
dialogStyle();
}
function VMClone(uuid, name){
-
- //var root = = '"'.$domain_cfg["MEDIADIR"].'"';?>;
- var match= ".iso";
var box = $("#dialogWindow");
- var height = 200;
box.html($("#templateClone").html());
- box.find('#VMBeingCloned').html(name).change() ;
- box.find('#target').val(name + "_clone") ;
- document.getElementById("Free").checked = true ;
- document.getElementById("Overwrite").checked = true ;
- var Cancel = _("Cancel") ;
+ box.find('#VMBeingCloned').html(name).change();
+ box.find('#target').val(name + "_clone");
+ document.getElementById("Free").checked = true;
+ document.getElementById("Overwrite").checked = true;
box.dialog({
- title: "VM Clone",
- resizable: false,
+ title: "_(VM Clone)_",
+ height: 'auto',
width: 600,
- height: 500,
+ resizable: false,
modal: true,
- show: {effect:'fade', duration:250},
- hide: {effect:'fade', duration:250},
buttons: {
- "_(Clone)_" : function(){
+ "_(Clone)_": function(){
var target = box.find('#target');
if (target.length) {
target = target.val();
- //if (!target ) {errorTarget(); return;}
+ //if (!target) {errorTarget(); return;}
} else target = '';
-
- var clone = box.find("#target").prop('value') ;
- x = box.find('#Start').prop('checked') ;
- if (x) start = 'yes' ; else start = 'no' ;
- x = box.find('#Edit').prop('checked') ;
- if (x) edit = 'yes' ; else edit = 'no' ;
- x = box.find('#Overwrite').prop('checked') ;
- if (x) overwrite = 'yes' ; else overwrite = 'no' ;
- x = box.find('#Free').prop('checked') ;
- if (x) free = 'yes' ; else free = 'no' ;
- scripturl = "VMClone.php " + encodeURIComponent("/usr/local/emhttp/plugins/dynamix.vm.manager/include/VMClone.php&" + $.param({action:"clone" , name:name ,clone:clone, overwrite:overwrite , edit:edit, start,start, free:free})) ;
- openVMAction((scripturl),"VM Clone", "dynamix.vm.manager", "loadlist") ;
+ var clone = box.find("#target").prop('value');
+ var start = box.find('#Start').prop('checked') ? 'yes' : 'no';
+ var edit = box.find('#Edit').prop('checked') ? 'yes' : 'no';
+ var overwrite = box.find('#Overwrite').prop('checked') ? 'yes' : 'no';
+ var free = box.find('#Free').prop('checked') ? 'yes' : 'no';
+ scripturl = "VMClone.php " + encodeURIComponent("/usr/local/emhttp/plugins/dynamix.vm.manager/include/VMClone.php&" + $.param({action:"clone", name:name, clone:clone, overwrite:overwrite, edit:edit, start:start, free:free}));
+ openVMAction((scripturl),"VM Clone", "dynamix.vm.manager", "loadlist");
box.dialog('close');
},
"_(Cancel)_": function(){
@@ -300,44 +238,30 @@ function VMClone(uuid, name){
});
dialogStyle();
}
-
-
function selectsnapshot(uuid, name ,snaps, opt, getlist,state){
-
- var root = = '"'.$domain_cfg["MEDIADIR"].'"';?>;
- var match= ".iso";
- var box = $("#dialogWindow2");
+ var box = $("#dialogWindow");
box.html($("#templatesnapshot"+opt).html());
- var height = 200;
- const Capopt = opt.charAt(0).toUpperCase() + opt.slice(1) ;
- var optiontext = Capopt + " Snapshot" ;
- box.find('#VMName').html(name) ;
- box.find('#targetsnap').val(snaps) ;
- box.find('#targetsnapl').html(snaps) ;
+ const capopt = opt.charAt(0).toUpperCase() + opt.slice(1);
+ var optiontext = capopt + " _(Snapshot)_";
+ box.find('#VMName').html(name);
+ box.find('#targetsnap').val(snaps);
+ box.find('#targetsnapl').html(snaps);
if (getlist) {
- var only = 1 ;
- if (opt == "remove") only = 0;
- $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:"snap-images", uuid:uuid , snapshotname:snaps, only:only}, function(data) {
- if (data.html) {
- box.find('#targetsnapimages').html(data.html) ;
- }
+ var only = (opt == "remove") ? 0 : 1;
+ $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:"snap-images", uuid:uuid, snapshotname:snaps, only:only}, function(data) {
+ if (data.html) box.find('#targetsnapimages').html(data.html);
},'json');
}
-
- document.getElementById("targetsnaprmv").checked = true ;
- document.getElementById("targetsnaprmvmeta").checked = true ;
- document.getElementById("targetsnapkeep").checked = true ;
- document.getElementById("targetsnapfspc").checked = true ;
-
+ document.getElementById("targetsnaprmv").checked = true;
+ document.getElementById("targetsnaprmvmeta").checked = true;
+ document.getElementById("targetsnapkeep").checked = true;
+ document.getElementById("targetsnapfspc").checked = true;
box.dialog({
- title: "_("+optiontext+ ")_",
- resizable: false,
+ title: optiontext,
+ height: 'auto',
width: 600,
- height: 500,
+ resizable: false,
modal: true,
- show: {effect:'fade', duration:250},
- hide: {effect:'fade', duration:250},
-
buttons: {
"_(Proceed)_": function(){
var target = box.find('#targetsnap');
@@ -345,26 +269,22 @@ function selectsnapshot(uuid, name ,snaps, opt, getlist,state){
target = target.val();
if (!target ) {errorTarget(); return;}
} else target = '';
- var remove = 'yes'
- var keep = 'yes'
- var removemeta = 'yes'
+ var remove = 'yes'
+ var keep = 'yes'
+ var removemeta = 'yes'
var free = 'yes'
var desc = ''
box.find('#targetsnap').prop('disabled',true);
if (opt == "revert") {
- var x = box.find('#targetsnaprmv').prop('checked') ;
- if (x) remove = 'yes' ; else remove = 'no' ;
- x = box.find('#targetsnaprmvmeta').prop('checked') ;
- if (x) removemeta = 'yes' ; else removemeta = 'no' ;
- x = box.find('#targetsnapkeep').prop('checked') ;
- if (x) keep = 'yes' ; else keep = 'no' ;
+ remove = box.find('#targetsnaprmv').prop('checked') ? 'yes' : 'no';
+ removemeta = box.find('#targetsnaprmvmeta').prop('checked') ? 'yes' : 'no';
+ keep = box.find('#targetsnapkeep').prop('checked') ? 'yes' : 'no';
}
- if (opt == "create") {
- var x = box.find('#targetsnapfspc').prop('checked') ;
- if (x) free = 'yes' ; else free = 'no' ;
- var desc = box.find("#targetsnapdesc").prop('value') ;
+ if (opt == "create") {
+ free = box.find('#targetsnapfspc').prop('checked') ? 'yes' : 'no';
+ desc = box.find("#targetsnapdesc").prop('value');
}
- ajaxVMDispatch({action:"snap-" + opt +'-external', uuid:uuid , snapshotname:target , remove:remove, free:free ,removemeta:removemeta ,keep:keep, desc:desc} , "loadlist");
+ ajaxVMDispatch({action:"snap-" + opt +'-external', uuid:uuid, snapshotname:target, remove:remove, free:free, removemeta:removemeta, keep:keep, desc:desc}, "loadlist");
box.dialog('close');
},
"_(Cancel)_": function(){
@@ -374,86 +294,72 @@ function selectsnapshot(uuid, name ,snaps, opt, getlist,state){
});
dialogStyle();
}
-
-function selectblock(uuid, name ,snaps, opt, getlist,state){
-
- var root = = '"'.$domain_cfg["MEDIADIR"].'"';?>;
- var match= ".iso";
- var box = $("#dialogWindow2");
+function selectblock(uuid, name, snaps, opt, getlist, state){
+ var box = $("#dialogWindow");
box.html($("#templateblock").html());
- var height = 200;
- const Capopt = opt.charAt(0).toUpperCase() + opt.slice(1) ;
- var optiontext = Capopt + " Block Devices" ;
- box.find('#VMName').html(name) ;
- box.find('#targetsnap').val(snaps) ;
- box.find('#targetsnapl').html(snaps) ;
-
- getlist = true ;
+ const capopt = opt.charAt(0).toUpperCase() + opt.slice(1);
+ var optiontext = capopt + " _(Block Devices)_";
+ box.find('#VMName').html(name);
+ box.find('#targetsnap').val(snaps);
+ box.find('#targetsnapl').html(snaps);
+ getlist = true;
if (getlist) {
- var only = 1 ;
+ var only = 1;
if (opt == "remove") only = 0;
- $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:"snap-list", uuid:uuid }, function(data) {
- if (data.html) {
- var targetbase = document.getElementById("targetblockbase") ;
- htmlstrbase = "
--base " + data.html + ""
- htmlstrtop = "
--top " + data.html + ""
- $("select.targetblockbase").replaceWith(htmlstrbase) ;
- $("select.targetblocktop").replaceWith(htmlstrtop) ;
- }
+ $.post("/plugins/dynamix.vm.manager/include/VMajax.php", {action:"snap-list", uuid:uuid}, function(data){
+ if (data.html) {
+ var targetbase = document.getElementById("targetblockbase");
+ htmlstrbase = "
--base " + data.html + ""
+ htmlstrtop = "
--top " + data.html + ""
+ $("select.targetblockbase").replaceWith(htmlstrbase);
+ $("select.targetblocktop").replaceWith(htmlstrtop);
+ }
},'json');
}
-
- document.getElementById("targetsnaprmv").checked = true ;
- document.getElementById("targetsnaprmvmeta").checked = true ;
- document.getElementById("targetsnapkeep").checked = true ;
- document.getElementById("targetsnapfspc").checked = true ;
- if (opt== "pull") {
- $('.toprow').hide();
- $('.targetpivotrow').hide();
- $('.targetdeleterow').hide();
- } else {
- $('.toprow').show();
- $('.targetpivotrow').show();
- $('.targetdeleterow').show();
- }
-
+ document.getElementById("targetsnaprmv").checked = true;
+ document.getElementById("targetsnaprmvmeta").checked = true;
+ document.getElementById("targetsnapkeep").checked = true;
+ document.getElementById("targetsnapfspc").checked = true;
+ if (opt == "pull") {
+ $('.toprow').hide();
+ $('.targetpivotrow').hide();
+ $('.targetdeleterow').hide();
+ } else {
+ $('.toprow').show();
+ $('.targetpivotrow').show();
+ $('.targetdeleterow').show();
+ }
box.dialog({
- title: "_("+optiontext+ ")_",
- resizable: false,
+ title: optiontext,
+ height: 'auto',
width: 600,
- height: 500,
+ resizable: false,
modal: true,
- show: {effect:'fade', duration:250},
- hide: {effect:'fade', duration:250},
buttons: {
- _("Action")_: function(){
+ "_(Action)_": function(){
var target = box.find('#targetsnap');
if (target.length) {
target = target.val();
if (!target ) {errorTarget(); return;}
} else target = '';
- var remove = 'yes'
- var keep = 'yes'
- var removemeta = 'yes'
+ var remove = 'yes'
+ var keep = 'yes'
+ var removemeta = 'yes'
var free = 'yes'
var delete_file = 'yes'
var pivot = 'yes'
var desc = ''
box.find('#targetsnap').prop('disabled',true);
if (opt == "create") {
- var x = box.find('#targetsnapfspc').prop('checked') ;
- if (x) free = 'yes' ; else free = 'no' ;
- var desc = box.find("#targetsnapdesc").prop('value') ;
+ free = box.find('#targetsnapfspc').prop('checked') ? 'yes' : 'no';
+ var desc = box.find("#targetsnapdesc").prop('value');
}
- var targetbase = box.find("#targetblockbase").prop('value') ;
- var targettop = box.find("#targetblocktop").prop('value') ;
-
- x = box.find('#targetpivot').prop('checked') ;
- if (x) pivot = 'yes' ; else pivot = 'no' ;
- x = box.find('#targetdelete').prop('checked') ;
- if (x) delete_file = 'yes' ; else delete_file = 'no' ;
- Ajaxurl = "VMAjaxCall.php " + encodeURIComponent("/usr/local/emhttp/plugins/dynamix.vm.manager/include/VMajax.php&" + $.param({action:opt , name:name ,targetbase:targetbase, targettop:targettop , snapshotname:target , remove:remove, targetpivot:pivot ,removemeta:removemeta ,targetdelete:delete_file})) ;
- openVMAction((Ajaxurl),"Block Commit", "dynamix.vm.manager", "loadlist") ;
+ var targetbase = box.find("#targetblockbase").prop('value');
+ var targettop = box.find("#targetblocktop").prop('value');
+ pivot = box.find('#targetpivot').prop('checked') ? 'yes' : 'no';
+ delete_file = box.find('#targetdelete').prop('checked') ? 'yes' : 'no';
+ Ajaxurl = "VMAjaxCall.php " + encodeURIComponent("/usr/local/emhttp/plugins/dynamix.vm.manager/include/VMajax.php&" + $.param({action:opt, name:name, targetbase:targetbase, targettop:targettop, snapshotname:target, remove:remove, targetpivot:pivot, removemeta:removemeta, targetdelete:delete_file}));
+ openVMAction((Ajaxurl),"Block Commit", "dynamix.vm.manager", "loadlist");
box.dialog('close');
},
"_(Cancel)_": function(){
@@ -463,13 +369,6 @@ function selectblock(uuid, name ,snaps, opt, getlist,state){
});
dialogStyle();
}
-
-function dialogStyle() {
- $('.ui-dialog-titlebar-close').css({'background':'transparent','border':'none','font-size':'1.8rem','margin-top':'-14px','margin-right':'-18px'}).html('
').prop('title');
- $('.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'});
-}
var sortableHelper = function(e,ui){
var child = ui.next();
if (child.is(':visible')) child.addClass('unhide').hide();
@@ -561,123 +460,75 @@ $(function() {
});
+
+ _(Name)__(Description)_ _(CPUs)_ _(Memory)_ _(vDisks / vCDs)_ _(Graphics)_ _(IP Address)_ _(Autostart)_
+
+
+
+
+
+
+
-
-_(ISO Image)_:
-:
+
+
-
-_(CD1 ISO Image)_:
-:
-_(CD2 ISO Image)_:
-:
+
-
-
-
-
- _(VM Name)_:
-
-_(Snapshot Name)_:
-
-_(Check free space)_:
-
-_(Description )_:
-
+
-
-_(VM Name)_:
-
-
-_(Snapshot Name)_:
-
-
-_(Remove Images)_:
-
-_(Remove Meta)_:
-
-
-
+
+_(VM Name)_:
+_(Snapshot Name)_:
+_(Remove Images)_:
+_(Remove Meta)_:
+
-
+
+
!! _(Warning removing Snapshots can break the chain)_ !!
-
-_(!! Warning removing Snapshots can break the chain !!)_
+_(VM Name)_:
+_(Snapshot Name)_:
+
-_(VM Name)_:
-
-
-_(Snapshot Name)_:
-
-
-
-
-
-
-_(VM Name)_:
-
-
-_(Snapshot Name)_:
-
-
-
-
-_(Base Image)_:
-
-
-_(Top Image )_:
-
-
- _(Pivot)_:
-
-_(Delete)_:
-
+
-
-
-lang="=strtok($locale,'_')?:'en'?>">
-
-
-
-
-
-
-
-
">
-
-
-
-
-_(VM Being Cloned)_:
-
-
-_(New VM)_:
-
-
-_(Overwrite)_:
-
-
-_(Start Cloned VM)_:
-
-
-_(Edit VM after clone)_:
-
-
-_(Check Free Space)_:
-
-
+
-
-
-
\ No newline at end of file
diff --git a/emhttp/plugins/dynamix.vm.manager/VMSettings.page b/emhttp/plugins/dynamix.vm.manager/VMSettings.page
index b7ca08f24..ee8227969 100644
--- a/emhttp/plugins/dynamix.vm.manager/VMSettings.page
+++ b/emhttp/plugins/dynamix.vm.manager/VMSettings.page
@@ -5,8 +5,8 @@ Tag="columns"
---
-
@@ -99,6 +84,14 @@ _(Enable VMs)_:
:vms_enable_help:
+_(Disable Autostart/Start option for VMs)_:
+:
+ = mk_option(htmlspecialchars($domain_cfg['DISABLE']), 'no', _('No'))?>
+ = mk_option(htmlspecialchars($domain_cfg['DISABLE']), 'yes', _('Yes'))?>
+
+
+:vms_disable_help:
+
@@ -233,7 +226,7 @@ _(VFIO allow unsafe interrupts)_:
_(btrfs filesystem show)_:
: ="
".shell_exec("btrfs filesystem show /etc/libvirt")." "?>
-
@@ -449,13 +470,13 @@
}
?>
-
-
+
+
$usbboothidden = "hidden" ;
if ($arrConfig['domain']['ovmf'] != '0') $usbboothidden = "" ;
?>
>_(Enable USB boot)_:
-
+
onchange="USBBootChange(this)">
echo mk_option($arrConfig['domain']['usbboot'], 'No', 'No');
@@ -493,7 +514,7 @@
_(Hyper-V)_:
-
+ onchange="HypervChgNew(this)" >
@@ -607,8 +628,8 @@
$boolShowAllDisks = (strpos($domain_cfg['DOMAINDIR'], '/mnt/user/') === 0);
if (!empty($arrDisk['new'])) {
- if (strpos($domain_cfg['DOMAINDIR'], dirname(dirname($arrDisk['new']))) === false ||
- basename(dirname($arrDisk['new'])) != $arrConfig['domain']['name'] ||
+ if (strpos($domain_cfg['DOMAINDIR'], dirname(dirname($arrDisk['new']))) === false ||
+ basename(dirname($arrDisk['new'])) != $arrConfig['domain']['name'] ||
basename($arrDisk['new']) != 'vdisk'.($i+1).'.img') {
$default_option = 'manual';
}
@@ -736,12 +757,12 @@
vDisk Bus
Select virtio for best performance.
-
+
vDisk Boot Order
Specify the order the devices are used for booting.
-
+
vDisk Serial
Set the device serial number presented to the VM.
@@ -837,7 +858,7 @@
-
+
_(Boot Order)_:
@@ -868,7 +889,7 @@
_(Unraid Share)_:
- $UnraidShareDisabled = ' disabled="disabled"' ;
+ $UnraidShareDisabled = ' disabled="disabled"' ;
$arrUnraidIndex = array_search("User:".$arrShare['target'],$arrUnraidShares) ;
if ($arrUnraidIndex != false && substr($arrShare['source'],0,10) != '/mnt/user/') $arrUnraidIndex = false ;
if ($arrUnraidIndex == false) $arrUnraidIndex = array_search("Disk:".$arrShare['target'],$arrUnraidShares) ;
@@ -876,11 +897,11 @@
mk_dropdown_options($arrUnraidShares, $arrUnraidIndex);?>
-
+
-
- _(Unraid Source Path)_:
+
+ _(Unraid Source Path)_:
id="shares[=$i?>][source]" name="shares[=$i?>][source]" autocomplete="off" data-pickfolders="true" data-pickfilter="NO_FILES_FILTER" data-pickroot="/mnt/" value="=htmlspecialchars($arrShare['source'])?>" placeholder="_(e.g.)_ /mnt/user/..." title="_(path of Unraid share)_" />
@@ -903,7 +924,7 @@
Used to create a VirtFS mapping to a Linux-based guest. Specify the mode you want to use either 9p or Virtiofs.
-
+
Unraid Share
Set tag and path to match the selected Unraid share.
@@ -918,8 +939,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 +960,12 @@
_(Unraid Share)_:
-
+
-
+
_(Unraid Source Path)_:
@@ -975,7 +996,7 @@
if ($i == 0) {
// Only the first video card can be VNC or SPICE
echo mk_option($arrGPU['id'], 'virtual', _('Virtual'));
-
+
} else {
echo mk_option($arrGPU['id'], '', _('None'));
}
@@ -985,10 +1006,21 @@
}
?>
+
+ if ($arrGPU['id'] != 'virtual') $multifunction = "" ; else $multifunction = " disabled " ;
+ ?>
+ _(Multifunction)_:
+
+ >
+
+ echo mk_option($arrGPU['guest']['multi'], 'off', 'Off');
+ echo mk_option($arrGPU['guest']['multi'], 'on', 'On');
+ ?>
+
-
-
+
>_(VM Console Port)_:
-
+
>
-
+
>_(VM Console WS Port)_:
-
+
>
@@ -1071,7 +1103,7 @@
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.
@@ -1081,7 +1113,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.
@@ -1122,6 +1154,13 @@
}
?>
+ _(Multifunction)_:
+
+
+ echo mk_option("off", 'off', 'Off');
+ echo mk_option("off", 'on', 'On');
+ ?>
+
@@ -1178,13 +1217,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) : '';
@@ -1308,7 +1347,7 @@
- _(Select)_  _(Optional)_  _(Boot Order)_
+ _(Select)_  _(Optional)_  _(Boot Order)_
_(USB Devices)_:
@@ -1318,9 +1357,9 @@
foreach($arrVMUSBs as $i => $arrDev) {
?>
    
- />         />     
+ />         />     
style="width: 50px;" name="usbboot[=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="=$arrDev['usbboot']?>" >
- =htmlspecialchars($arrDev['name'])?> (=htmlspecialchars($arrDev['id'])?>)
+ =htmlspecialchars(substr($arrDev['name'],0,100))?> (=htmlspecialchars($arrDev['id'])?>)
}
} else {
@@ -1339,7 +1378,7 @@
- _(Select)_  _(Boot Order)_
+ _(Select)_  _(Boot Order)_
_(Other PCI Devices)_:
@@ -1355,14 +1394,14 @@
if (count($pcidevice=array_filter($arrConfig['pci'], function($arr) use ($arrDev) { return ($arr['id'] == $arrDev['id']); }))) {
$extra .= ' checked="checked"';
foreach ($pcidevice as $pcikey => $pcidev) $pciboot = $pcidev["boot"]; ;
-
+
} elseif (!in_array($arrDev['driver'], ['pci-stub', 'vfio-pci'])) {
//$extra .= ' disabled="disabled"';
continue;
}
$intAvailableOtherPCIDevices++;
?>
-      />  
+      />  
style="width: 50px;" name="pciboot[=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="=$pciboot?>" >
=htmlspecialchars($arrDev['name'])?> | =htmlspecialchars($arrDev['type'])?> (=htmlspecialchars($arrDev['id'])?>)
@@ -1382,6 +1421,8 @@
Use boot order to set device as bootable and boot sequence. Only NVMe and Network devices (PCI types 0108 and 02xx) supported for boot order.
+
+
@@ -1404,6 +1445,106 @@
Click Create to generate the vDisks and return to the Virtual Machines page where your new VM will be created.
}?>
+
+
+
+ _(Advanced tuning options)_
+
+ _(QEMU Command Line)_:
+
+ if ($arrConfig['qemucmdline'] == "") $qemurows = 2 ; else $qemurows = 15 ;
+ ?>
+
+ style="width: 850px" onchange="QEMUChgCmd(this)">=htmlspecialchars($arrConfig['qemucmdline'])?>
+
+
+
+
+ If you need to add QEMU arguments to the XML
+ Examples can be found on the Libvirt page => https://libvirt.org/kbase/qemu-passthrough-security.html
+
+
+
+
+ _(Clocks)_
+ _(Clocks Offset)_:
+
+ $clockdisabled = "" ;?>
+ id="clockoffset" class="narrow" title="_(Clock Offset)_" =$arrConfig["domain"]['clock']?>>
+
+ echo mk_option($arrConfig['domain']['clock'], 'localtime', 'Localtime');
+ echo mk_option($arrConfig['domain']['clock'], 'utc', "UTC");
+ ?>
+
+
+
+ $clockcount = 0 ;
+ if (!empty($arrClocks)) {
+ foreach($arrClocks as $i => $arrTimer) {
+ if ($i =="offset") continue ;
+ if ($clockcount == 0) $clocksourcetext = _("Timer Source").":" ;else $clocksourcetext = "" ;
+ ?>
+ =$clocksourcetext?>
+
+ =ucfirst($i)?>:
+
+ _(Present)_:
+ id="clock[=$i?>][present]" class="narrow" title="_(Clock Offset)_" =$arrTimer["present"]?>>
+
+ echo mk_option($arrTimer["present"], 'yes', 'Yes');
+ echo mk_option($arrTimer["present"], 'no', "No");
+ ?>
+
+
+ _(Tickpolicy)_:
+ id="clock[=$i?>][tickpolicy]" class="narrow" title="_(Clock Offset)_" =$arrTimer["tickpolicy"]?>>
+
+ echo mk_option($arrTimer["tickpolicy"], 'delay', 'Delay');
+ echo mk_option($arrTimer["tickpolicy"], 'catchup', 'Catchup');
+ echo mk_option($arrTimer["tickpolicy"], 'merge', "Merge");
+ echo mk_option($arrTimer["tickpolicy"], 'discard', "Discard");
+ ?>
+
+
+
+ $clockcount++ ;
+ }
+ }
+ ?>
+
+
+
+
+ Allows setting of timers and offset into the XML You should not need to modify these values.
+ Windows tuning details can be found here https://forums.unraid.net/topic/134041-guide-optimizing-windows-vms-in-unraid/
+ Details can be found on the Libvirt XML page => https://libvirt.org/formatdomain.html#time-keeping
+ Defaults are:
+ linux Hpet:no Hypervclock: no Pit yes rtc yes tickpolicy catchup.
+ Windows Hpet:no Hypervclock: yes Pit yes rtc yes tickpolicy catchup.
+ Windows and Hyperv Hpet:no Hypervclock: yes Pit no rtc no.
+
+
+
+
+
+
+ Click Create to generate the vDisks and return to the Virtual Machines page where your new VM will be created.
+
+ }?>
@@ -1453,8 +1594,8 @@ function ShareChange(share) {
var path = "/mnt/" + strArray[1] ;
}
if (strArray[0] != "Manual") {
- document.getElementById(name+"[target]").value = strArray[1] ;
- document.getElementById(name+"[source]").value = path ;
+ document.getElementById(name+"[target]").value = strArray[1] ;
+ document.getElementById(name+"[source]").value = path ;
document.getElementById(name+"[target]").setAttribute("disabled","disabled");
document.getElementById(name+"[source]").setAttribute("disabled","disabled");
} else {
@@ -1476,6 +1617,28 @@ function BIOSChange(bios) {
}
}
+function QEMUChgCmd(qemu) {
+ var value = qemu.value;
+ if (value != "") {
+ document.getElementById("qemucmdline").setAttribute("rows","15");
+ } else {
+ document.getElementById("qemucmdline").setAttribute("rows","2");
+ }
+}
+
+function HypervChgNew(hyperv) {
+ var value = hyperv.value;
+ if (value == "0") {
+ var clockdefault = "windows" ;
+ document.getElementById("clock[rtc][present]").value = "=$arrDefaultClocks['windows']['rtc']['present']?>" ;
+ document.getElementById("clock[pit][present]").value = "=$arrDefaultClocks['windows']['pit']['present']?>" ;
+ } else {
+ var clockdefault = "hyperv" ;
+ document.getElementById("clock[rtc][present]").value = "=$arrDefaultClocks['hyperv']['rtc']['present']?>" ;
+ document.getElementById("clock[pit][present]").value = "=$arrDefaultClocks['hyperv']['pit']['present']?>";
+ }
+}
+
function SetBootorderfields(usbbootvalue) {
var bootelements = document.getElementsByClassName("bootorder");
for(var i = 0; i < bootelements.length; i++) {
@@ -1485,18 +1648,18 @@ function SetBootorderfields(usbbootvalue) {
} else bootelements[i].removeAttribute("disabled");
}
var bootelements = document.getElementsByClassName("pcibootorder");
- const bootpcidevs =
+ const bootpcidevs =
$devlist = [] ;
foreach($arrValidOtherDevices as $i => $arrDev) {
if ($arrDev["typeid"] != "0108" && substr($arrDev["typeid"],0,2) != "02") $devlist[$arrDev['id']] = "N" ; else $devlist[$arrDev['id']] = "Y" ;
}
echo json_encode($devlist) ;
- ?>
+ ?>
for(var i = 0; i < bootelements.length; i++) {
let bootpciid = bootelements[i].name.split('[') ;
bootpciid= bootpciid[1].replace(']', '') ;
-
+
if (usbbootvalue == "Yes") {
bootelements[i].value = "";
bootelements[i].setAttribute("disabled","disabled");
@@ -1534,7 +1697,7 @@ function AutoportChange(autoport) {
document.getElementById("wsport").style.visibility="hidden";
document.getElementById("WSPorttext").style.visibility="hidden";
}
- }
+ }
}
function ProtocolChange(protocol) {
@@ -1558,10 +1721,10 @@ function ProtocolChange(protocol) {
document.getElementById("wsport").style.visibility="hidden";
document.getElementById("WSPorttext").style.visibility="hidden";
}
- }
+ }
}
-
-
+
+
@@ -1729,7 +1892,7 @@ $(function() {
var auto_serial = 'vdisk' + (index+1) ;
$disk_serial.val(auto_serial);
- }
+ }
});
};
@@ -1815,6 +1978,23 @@ $(function() {
}
});
+ $("#vmform").on("change", ".cpu", function changeCPUEvent() {
+ var myvalue = $(this).val();
+ var mylabel = $(this).children('option:selected').text();
+ var cpumigrate = document.getElementById("domain_cpumigrate_text") ;
+ var cpumigrate_text = document.getElementById("domain_cpumigrate") ;
+ if (myvalue == "custom") {
+ document.getElementById("domain_cpumigrate_text").style.visibility="hidden";
+ document.getElementById("domain_cpumigrate").style.visibility="hidden";
+ } else {
+ document.getElementById("domain_cpumigrate_text").style.display="inline";
+ document.getElementById("domain_cpumigrate_text").style.visibility="visible";
+ document.getElementById("domain_cpumigrate").style.display="inline";
+ document.getElementById("domain_cpumigrate").style.visibility="visible";
+ }
+
+ }) ;
+
$("#vmform").on("change", ".gpu", function changeGPUEvent() {
var myvalue = $(this).val();
var mylabel = $(this).children('option:selected').text();
@@ -1825,9 +2005,13 @@ $(function() {
if (myvalue == 'virtual') {
$vnc_sections.filter('.wasadvanced').removeClass('wasadvanced').addClass('advanced');
slideDownRows($vnc_sections.not(isVMAdvancedMode() ? '.basic' : '.advanced'));
+ var MultiSel = document.getElementById("GPUMultiSel0") ;
+ MultiSel.disabled = true ;
} else {
slideUpRows($vnc_sections);
$vnc_sections.filter('.advanced').removeClass('advanced').addClass('wasadvanced');
+ var MultiSel = document.getElementById("GPUMultiSel0") ;
+ MultiSel.disabled = false ;
}
}
@@ -1895,7 +2079,7 @@ $(function() {
if (audio && !sound.includes(audio)) form.append(' ');
});
- var postdata = form.find('input,select').serialize().replace(/'/g,"%27");
+ var postdata = form.find('input,select,textarea[name="qemucmdline"').serialize().replace(/'/g,"%27");
// keep checkbox visually unchecked
form.find('input[name="usb[]"],input[name="usbopt[]"],input[name="pci[]"]').each(function(){
@@ -1972,6 +2156,7 @@ $(function() {
});
} else {
$('#vmform #domain_clock').val('utc');
+ $('#vmform #clockoffset').val('utc');
$("#vmform #domain_machine option").each(function(){
if ($(this).val().indexOf('q35') != -1) {
$('#vmform #domain_machine').val($(this).val()).change();
diff --git a/emhttp/plugins/dynamix.vm.manager/templates/LibreELEC.form.php b/emhttp/plugins/dynamix.vm.manager/templates/LibreELEC.form.php
index 693b36e48..88556695d 100644
--- a/emhttp/plugins/dynamix.vm.manager/templates/LibreELEC.form.php
+++ b/emhttp/plugins/dynamix.vm.manager/templates/LibreELEC.form.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/webGui/include/Custom.php";
+ require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
+
// add translations
if (substr($_SERVER['REQUEST_URI'],0,4) != '/VMs') {
$_SERVER['REQUEST_URI'] = 'vms';
require_once "$docroot/webGui/include/Translations.php";
}
- require_once "$docroot/webGui/include/Helpers.php";
- require_once "$docroot/webGui/include/Custom.php";
- require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
$arrValidMachineTypes = getValidMachineTypes();
$arrValidGPUDevices = getValidGPUDevices();
@@ -292,6 +293,7 @@ $hdrXML = "\n"; // XML encoding declaratio
if (isset($_POST['shares'][0]['source'])) {
@mkdir($_POST['shares'][0]['source'], 0777, true);
}
+ $_POST['clock'] = $arrDefaultClocks["other"] ;
if ($lv->domain_new($_POST)){
$reply = ['success' => true];
} else {
@@ -375,6 +377,7 @@ $hdrXML = "\n"; // XML encoding declaratio
if (isset($_POST['shares'][0]['source'])) {
@mkdir($_POST['shares'][0]['source'], 0777, true);
}
+ $_POST['clock'] = $arrDefaultClocks["other"] ;
$arrExistingConfig = custom::createArray('domain',$strXML);
$arrUpdatedConfig = custom::createArray('domain',$lv->config_to_xml($_POST));
array_update_recursive($arrExistingConfig, $arrUpdatedConfig);
@@ -666,12 +669,12 @@ $hdrXML = "\n"; // XML encoding declaratio
}
?>
-
+
$usbboothidden = "hidden" ;
if ($arrConfig['domain']['ovmf'] != '0') $usbboothidden = "" ;
?>
>_(Enable USB boot)_:
-
+
onchange="USBBootChange(this)">
echo mk_option($arrConfig['domain']['usbboot'], 'No', 'No');
@@ -748,7 +751,7 @@ $hdrXML = "\n"; // XML encoding declaratio
- \n"; // XML encoding declaratio
echo mk_option($arrGPU['autoport'], 'no', _('No'));
?>
-
+
>_(VM Console Port)_:
-
+
>
-
+
>_(VM Console WS Port)_:
-
+
>
@@ -800,19 +803,19 @@ $hdrXML = "\n"; // XML encoding declaratio
virtual video protocol VDA/SPICE
If you wish to assign a protocol type, specify one here.
-
+
Graphics Card
If you wish to assign a graphics card to the VM, select it from this list, otherwise leave it set to virtual.
virtual video protocol VDC/SPICE
- If you wish to assign a protocol type, specify one here.
+ If you wish to assign a protocol type, specify one here.
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.
@@ -898,15 +901,15 @@ $hdrXML = "\n"; // XML encoding declaratio
-
+
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) : '';
@@ -951,7 +954,7 @@ $hdrXML = "\n"; // XML encoding declaratio
style="width: 50px;" name="nic[=$i?>][boot]" title="_(Boot order)_" value="=$arrNic['boot']?>" >
-
+
@@ -1025,7 +1028,7 @@ $hdrXML = "\n"; // XML encoding declaratio
- _(Select)_  _(Optional)_  _(Boot Order)_
+ _(Select)_  _(Optional)_  _(Boot Order)_
_(USB Devices)_:
@@ -1057,7 +1060,7 @@ $hdrXML = "\n"; // XML encoding declaratio
- _(Select)_  _(Boot Order)_
+ _(Select)_  _(Boot Order)_
_(Other PCI Devices)_:
@@ -1073,14 +1076,14 @@ $hdrXML = "\n"; // XML encoding declaratio
if (count($pcidevice=array_filter($arrConfig['pci'], function($arr) use ($arrDev) { return ($arr['id'] == $arrDev['id']); }))) {
$extra .= ' checked="checked"';
foreach ($pcidevice as $pcikey => $pcidev) $pciboot = $pcidev["boot"]; ;
-
+
} elseif (!in_array($arrDev['driver'], ['pci-stub', 'vfio-pci'])) {
//$extra .= ' disabled="disabled"';
continue;
}
$intAvailableOtherPCIDevices++;
?>
-      />  
+      />  
style="width: 50px;" name="pciboot[=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="=$pciboot?>" >
=htmlspecialchars($arrDev['name'])?> | =htmlspecialchars($arrDev['type'])?> (=htmlspecialchars($arrDev['id'])?>)
@@ -1159,7 +1162,7 @@ $hdrXML = "\n"; // XML encoding declaratio
$domain_bridge,
'mac' => "",
@@ -944,7 +947,7 @@ $hdrXML = "\n"; // XML encoding declaratio
style="width: 50px;" name="nic[=$i?>][boot]" title="_(Boot order)_" value="=$arrNic['boot']?>" >
-
+
@@ -1018,7 +1021,7 @@ $hdrXML = "\n"; // XML encoding declaratio
- _(Select)_  _(Optional)_  _(Boot Order)_
+ _(Select)_  _(Optional)_  _(Boot Order)_
_(USB Devices)_:
@@ -1029,7 +1032,7 @@ $hdrXML = "\n"; // XML encoding declaratio
foreach($arrVMUSBs as $i => $arrDev) {
?>
    
- />         />     
+ />         />     
style="width: 50px;" name="usbboot[=htmlspecialchars($arrDev['id'])?>]]" title="_(Boot order)_" value="=$arrDev['usbboot']?>" >
=htmlspecialchars($arrDev['name'])?> (=htmlspecialchars($arrDev['id'])?>)
@@ -1050,7 +1053,7 @@ $hdrXML = "\n"; // XML encoding declaratio
- _(Select)_  _(Boot Order)_
+ _(Select)_  _(Boot Order)_
_(Other PCI Devices)_:
@@ -1066,14 +1069,14 @@ $hdrXML = "\n"; // XML encoding declaratio
if (count($pcidevice=array_filter($arrConfig['pci'], function($arr) use ($arrDev) { return ($arr['id'] == $arrDev['id']); }))) {
$extra .= ' checked="checked"';
foreach ($pcidevice as $pcikey => $pcidev) $pciboot = $pcidev["boot"]; ;
-
+
} elseif (!in_array($arrDev['driver'], ['pci-stub', 'vfio-pci'])) {
//$extra .= ' disabled="disabled"';
continue;
}
$intAvailableOtherPCIDevices++;
?>
-      />  
+      />  
style="width: 50px;" name="pciboot[=htmlspecialchars($arrDev['id'])?>]" title="_(Boot order)_" value="=$pciboot?>" >
=htmlspecialchars($arrDev['name'])?> | =htmlspecialchars($arrDev['type'])?> (=htmlspecialchars($arrDev['id'])?>)
@@ -1175,18 +1178,18 @@ function SetBootorderfields(usbbootvalue) {
} else bootelements[i].removeAttribute("disabled");
}
var bootelements = document.getElementsByClassName("pcibootorder");
- const bootpcidevs =
+ const bootpcidevs =
$devlist = [] ;
foreach($arrValidOtherDevices as $i => $arrDev) {
if ($arrDev["typeid"] != "0108") $devlist[$arrDev['id']] = "N" ; else $devlist[$arrDev['id']] = "Y" ;
}
echo json_encode($devlist) ;
- ?>
+ ?>
for(var i = 0; i < bootelements.length; i++) {
let bootpciid = bootelements[i].name.split('[') ;
bootpciid= bootpciid[1].replace(']', '') ;
-
+
if (usbbootvalue == "Yes") {
bootelements[i].value = "";
bootelements[i].setAttribute("disabled","disabled");
@@ -1224,7 +1227,7 @@ function AutoportChange(autoport) {
document.getElementById("wsport").style.visibility="hidden";
document.getElementById("WSPorttext").style.visibility="hidden";
}
- }
+ }
}
function ProtocolChange(protocol) {
@@ -1248,7 +1251,7 @@ function ProtocolChange(protocol) {
document.getElementById("wsport").style.visibility="hidden";
document.getElementById("WSPorttext").style.visibility="hidden";
}
- }
+ }
}
$(function() {
function completeAfter(cm, pred) {
@@ -1292,7 +1295,7 @@ $(function() {
});
SetBootorderfields("=$arrConfig['domain']['usbboot']?>") ;
-
+
function resetForm() {
$("#vmform .domain_vcpu").change(); // restore the cpu checkbox disabled states
diff --git a/emhttp/plugins/dynamix.vm.manager/templates/XML_Expert.form.php b/emhttp/plugins/dynamix.vm.manager/templates/XML_Expert.form.php
index 666b868a7..b73ede75a 100644
--- a/emhttp/plugins/dynamix.vm.manager/templates/XML_Expert.form.php
+++ b/emhttp/plugins/dynamix.vm.manager/templates/XML_Expert.form.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.vm.manager/include/libvirt_helpers.php";
+
// add translations
if (substr($_SERVER['REQUEST_URI'],0,4) != '/VMs') {
$_SERVER['REQUEST_URI'] = 'vms';
require_once "$docroot/webGui/include/Translations.php";
}
- require_once "$docroot/webGui/include/Helpers.php";
- require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php";
$hdrXML = "\n"; // XML encoding declaration
diff --git a/emhttp/plugins/dynamix/Apps.page b/emhttp/plugins/dynamix/Apps.page
index e816baebf..50826bfad 100644
--- a/emhttp/plugins/dynamix/Apps.page
+++ b/emhttp/plugins/dynamix/Apps.page
@@ -3,8 +3,8 @@ Name="Apps"
Code="e942"
---
-
-
@@ -244,7 +184,7 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px}
=_var($var,'NAME')?>
-=_var($var,'COMMENT')?>
+=_var($var,'COMMENT')?>
@@ -258,6 +198,7 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px}
+
=_var($var,'SYS_MODEL')?:'---'?>
Unraid OS
=_var($var,'regTy')?>
@@ -287,11 +228,13 @@ input[value=Edit]{margin:12px 0 0 0;padding:5px 10px}
-_(Processor)_
+_(Processor)_
+
+
_(Load)_:0%
=$cpumodel?>
-_(Overall Load)_: 0%
+_(Overall Load)_: 0%
_(Show details)_
=mk_option("","10", _("10 s"));?>
@@ -305,9 +248,9 @@ foreach ($cpus as $pair) {
[$cpu1, $cpu2] = my_preg_split('/[,-]/',$pair);
echo "";
if ($cpu2)
- echo "CPU $cpu1 - HT $cpu2 0%
0%
";
+ echo "CPU $cpu1 - HT $cpu2 0%
0%
";
else
- echo "CPU $cpu1 0%
";
+ echo "CPU $cpu1 0%
";
echo " ";
}
?>
@@ -315,26 +258,27 @@ foreach ($cpus as $pair) {
-_(System)_ _(Memory)_: ="$memory_installed $unit $memory_type $ecc"?>
+_(System)_
+
_(Memory)_: ="$memory_installed $unit $memory_type $ecc"?>
+
_(RAM)_:0%
_(Usable size)_: =my_scale($total,$unit,1,null,1024)." $unit"?> _(Maximum size)_: ="$memory_maximum $unit"?>=$low?'*':''?>
- _(RAM)_0%
- _(ZFS)_0%
- _(Flash)_0%
- _(Log)_0%
- _(Docker)_0%
+ _(RAM)_0%
+ _(ZFS)_0%
+ _(Flash)_0%
+ _(Log)_0%
+ _(Docker)_0%
-_(Interface)_
-
_(Inbound)_: --- _(Outbound)_: ---
-
+_(Interface)_
+
=mk_option("",$port,_($port))?>
-
-
+
+ _(Inbound)_: --- _(Outbound)_: ---
@@ -376,7 +320,7 @@ foreach ($ports as $port) {
-_(VPN)_ _(Active tunnels)_: =$up?> _(Inactive tunnels)_: =$down?>
+_(VPN)_ _(Active tunnels)_: =$up?> _(Inactive tunnels)_: =$down?>
@@ -392,8 +336,9 @@ foreach ($ports as $port) {
-_(Power)_
- _(UPS Model)_:
+_(Power)_
+ _(UPS Model)_:
+_(Load)_:
_(UPS status)_:
@@ -449,7 +394,8 @@ echo "";
_(Docker Containers)_
-
+
+
@@ -457,7 +403,8 @@ echo " ";
_(Virtual Machines)_
-
+
+
@@ -467,14 +414,14 @@ echo " ";
class="mixed">
_(Shares)_
-
+
=mk_option("", "0", "SMB")?>
=mk_option("", "2", "NFS")?>
-
+
=sprintf(_("Share count: %s with %s cache only and %s encrypted"),count($shares),$cache_only,$encrypted)?>
@@ -525,14 +472,14 @@ if (!$group) {
class="mixed">
_(Users)_
-
+
=mk_option("", "0", "SMB")?>
=mk_option("", "2", "NFS")?>
-
+
=sprintf(_("User count: %s with %s unprotected"),count($users),$nopass)?>
@@ -623,7 +570,7 @@ if (!$group) {
$i=0?>
-=ucfirst($pool)?> (_(stopped)_)
+
=_(native($pool),3).($started ? '' : ' ('._('stopped').')')?>
=sprintf(_("%s used of %s (%s %%)"),my_scale($cache_used[$pool]*1024,$unit)." $unit",my_scale($cache_size[$pool]*1024,$unit,-1,-1)." $unit",$cache_rate[$pool])?>
@@ -652,6 +599,7 @@ if (!$group) {
'>
+
@@ -678,9 +626,11 @@ function hideShow() {
var id = tbody.parent().prop('id');
if ($(this).prop('checked')) {
tbody.show();
+ tbody.prev().show();
count[id]++;
} else {
tbody.hide();
+ tbody.prev().hide();
inactive.push(sort[n]);
}
n++;
@@ -700,6 +650,25 @@ function hideShow() {
!-->
+
+
+
+
-
-
-
-lang="=strtok($locale,'_')?:'en'?>">
-
-
-
-
-
-
-
-
">
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/emhttp/plugins/dynamix/DateTime.page b/emhttp/plugins/dynamix/DateTime.page
index f141e48c9..d7fdaae60 100644
--- a/emhttp/plugins/dynamix/DateTime.page
+++ b/emhttp/plugins/dynamix/DateTime.page
@@ -4,8 +4,8 @@ Icon="icon-clock"
Tag="clock-o"
---
-$keys = explode("\n", file_get_contents('webGui/include/timezones.key'));?>
-
+
+$keys = explode("\n",file_get_contents("$docroot/webGui/include/timezones.key"));
+?>
+
_(Current date and time)_:
: =_(my_time(time()),0)?>
+_(Date format)_:
+:
+ =mk_option($display['date'], "%c","_(System Setting)_")?>
+ =mk_option($display['date'], "%A, %Y %B %e",_('Day, YYYY Month D'))?>
+ =mk_option($display['date'], "%A, %e %B %Y",_('Day, D Month YYYY'))?>
+ =mk_option($display['date'], "%A, %B %e, %Y",_('Day, Month D, YYYY'))?>
+ =mk_option($display['date'], "%A, %m/%d/%Y",_('Day, MM/DD/YYYY'))?>
+ =mk_option($display['date'], "%A, %d-%m-%Y",_('Day, DD-MM-YYYY'))?>
+ =mk_option($display['date'], "%A, %d.%m.%Y",_('Day, DD.MM.YYYY'))?>
+ =mk_option($display['date'], "%A, %Y-%m-%d",_('Day, YYYY-MM-DD'))?>
+
+
+_(Time format)_:
+:
+ =mk_option($display['time'], "%I:%M %p",_('12 hours'))?>
+ =mk_option($display['time'], "%R",_('24 hours'))?>
+
+
_(Time zone)_:
-:
+:
foreach ($keys as $key) {
[$timezone, $city] = my_explode('|', $key);
echo mk_option($var['timeZone'], $timezone, $city);
@@ -32,7 +52,7 @@ _(Time zone)_:
:timezone_help:
_(Use NTP)_:
-:
+:
=mk_option($var['USE_NTP'], "yes", _('Yes'))?>
=mk_option($var['USE_NTP'], "no", _('No'))?>
@@ -65,12 +85,26 @@ _(New date and time)_:
:current_time_help:
-:
+:
diff --git a/emhttp/plugins/dynamix/DeviceIdentify.page b/emhttp/plugins/dynamix/DeviceIdentify.page
index e5d632b15..3374e6422 100644
--- a/emhttp/plugins/dynamix/DeviceIdentify.page
+++ b/emhttp/plugins/dynamix/DeviceIdentify.page
@@ -15,10 +15,6 @@ Cond="strpos(_var($disks[$name],'status'),'_NP')===false"
* all copies or substantial portions of the Software.
*/
?>
-
:display_settings_help:
-
+
+
+_(Display width)_:
+:
+ =mk_option($display['width'], "",_('Boxed'))?>
+ =mk_option($display['width'], "1",_('Unlimited'))?>
+
+
+:display_width_help:
+
_(Language)_:
:
- =mk_option($display['date'], "%c","_(System Setting)_")?>
- =mk_option($display['date'], "%A, %Y %B %e",_('Day, YYYY Month D'))?>
- =mk_option($display['date'], "%A, %e %B %Y",_('Day, D Month YYYY'))?>
- =mk_option($display['date'], "%A, %B %e, %Y",_('Day, Month D, YYYY'))?>
- =mk_option($display['date'], "%A, %m/%d/%Y",_('Day, MM/DD/YYYY'))?>
- =mk_option($display['date'], "%A, %d-%m-%Y",_('Day, DD-MM-YYYY'))?>
- =mk_option($display['date'], "%A, %d.%m.%Y",_('Day, DD.MM.YYYY'))?>
- =mk_option($display['date'], "%A, %Y-%m-%d",_('Day, YYYY-MM-DD'))?>
-
-
-_(Time format)_:
-:
- =mk_option($display['time'], "%I:%M %p",_('12 hours'))?>
- =mk_option($display['time'], "%R",_('24 hours'))?>
-
-
_(Number format)_:
:
=mk_option($display['number'], ".,",_('[D] dot : [G] comma'))?>
diff --git a/emhttp/plugins/dynamix/Eth0.page b/emhttp/plugins/dynamix/Eth0.page
index ed54cfc88..1d614fec2 100644
--- a/emhttp/plugins/dynamix/Eth0.page
+++ b/emhttp/plugins/dynamix/Eth0.page
@@ -71,20 +71,6 @@ $vlan_eth0 = $sort_eth0 = [];
if (isset($eth0)) foreach (vlanID($eth0) as $key => $val) {$vlan_eth0[] = index($key); $sort_eth0[] = (int)$val;}
array_multisort($sort_eth0,$vlan_eth0);
?>
-
-
+
:sysdrivers_intro_help:
diff --git a/emhttp/plugins/dynamix/Syslinux.page b/emhttp/plugins/dynamix/Syslinux.page
index bf088843e..e01948918 100644
--- a/emhttp/plugins/dynamix/Syslinux.page
+++ b/emhttp/plugins/dynamix/Syslinux.page
@@ -3,8 +3,8 @@ Title="Syslinux Configuration"
Tag="edit"
---
-
+
diff --git a/emhttp/plugins/dynamix/UserEdit.page b/emhttp/plugins/dynamix/UserEdit.page
index e14b7e2d8..4a4f937c2 100644
--- a/emhttp/plugins/dynamix/UserEdit.page
+++ b/emhttp/plugins/dynamix/UserEdit.page
@@ -3,8 +3,8 @@ Title="Edit User"
Tag="user"
---
-
-
diff --git a/emhttp/plugins/dynamix/UserList.page b/emhttp/plugins/dynamix/UserList.page
index c80219759..c81cfdc46 100644
--- a/emhttp/plugins/dynamix/UserList.page
+++ b/emhttp/plugins/dynamix/UserList.page
@@ -19,13 +19,6 @@ $submenu = !empty($display['users']) && substr($display['users'],0,5)!='Tasks';
if ($submenu) $path = './Users';
ksort($users);
?>
-
-
_(Management Access)_
$img = "/boot/config/plugins/dynamix/users/root.png"?>
diff --git a/emhttp/plugins/dynamix/Vars.page b/emhttp/plugins/dynamix/Vars.page
index 48d15a661..c15913b17 100644
--- a/emhttp/plugins/dynamix/Vars.page
+++ b/emhttp/plugins/dynamix/Vars.page
@@ -27,7 +27,7 @@ $(function() {
-$myPage['text'] = $page['text'] = $pages['Vars']['text'] = $language = $text = $notes = $site = '...';
+$myPage['text'] = $page['text'] = $pages['Vars']['text'] = $language = $text = $notes = $site = $webComponentTranslations = '...';
$globals = $GLOBALS;
ksort($globals);
if (isset($globals['_SERVER']['PHP_AUTH_PW'])) $globals['_SERVER']['PHP_AUTH_PW'] = "***";
diff --git a/emhttp/plugins/dynamix/WG0.page b/emhttp/plugins/dynamix/WG0.page
index 36317690d..29419de2d 100644
--- a/emhttp/plugins/dynamix/WG0.page
+++ b/emhttp/plugins/dynamix/WG0.page
@@ -27,7 +27,7 @@ exec("ip -br -6 addr show scope global|awk '/^(br|bond|eth)[0-9]+(\\.[0-9]+)?/{s
exec("ls --indicator-style=none $etc/wg*.conf*|grep -Po wg[0-9]+",$vtuns);
exec("docker network ls --filter driver='macvlan' --filter driver='ipvlan' --format='{{.Name}}' 2>/dev/null",$filter);
-$nginx = @parse_ini_file('state/nginx.ini') ?: [];
+$nginx = (array)@parse_ini_file('state/nginx.ini');
// add subnets defined in Docker custom networks
if (count($filter)) {
@@ -138,21 +138,22 @@ $server = ipaddr($ethX);
$dnsserver = _var($$ethX,'DNS_SERVER1');
$link = iflink($ethX);
+$vhost = str_replace(['eth','br','bond'],'vhost',$link);
$postUp0 = "$script add $link WireGuard- $server udp";
$postUp1 = "logger -t wireguard -- 'Tunnel WireGuard- started';$services";
-$postUp2 = "iptables -t nat -A POSTROUTING -s -o $link -j MASQUERADE";
+$postUp2 = "iptables -t nat -A POSTROUTING -s -o $link -j MASQUERADE;iptables -t nat -A POSTROUTING -s -o $vhost -j MASQUERADE";
$postUp3 = "iptables -N WIREGUARD_DROP_;iptables -A WIREGUARD -o $link -j WIREGUARD_DROP_";
$postUpX = "iptables -A WIREGUARD_DROP_ -s -d -j DROP";
$postUpZ = "iptables -A WIREGUARD_DROP_ -s -j ACCEPT;iptables -A WIREGUARD_DROP_ -j RETURN";
-$postUp26 = "ip6tables -t nat -A POSTROUTING -s -o $link -j MASQUERADE";
+$postUp26 = "ip6tables -t nat -A POSTROUTING -s -o $link -j MASQUERADE;ip6tables -t nat -A POSTROUTING -s -o $vhost -j MASQUERADE";
$postUp36 = "ip6tables -N WIREGUARD_DROP_;ip6tables -A WIREGUARD -o $link -j WIREGUARD_DROP_";
$postUpX6 = "ip6tables -A WIREGUARD_DROP_ -s -d -j DROP";
$postUpZ6 = "ip6tables -A WIREGUARD_DROP_ -s -j ACCEPT;ip6tables -A WIREGUARD_DROP_ -j RETURN";
$postDown0 = "$script del $link udp";
$postDown1 = "logger -t wireguard -- 'Tunnel WireGuard- stopped';$services";
-$postDown2 = "iptables -t nat -D POSTROUTING -s -o $link -j MASQUERADE";
+$postDown2 = "iptables -t nat -D POSTROUTING -s -o $link -j MASQUERADE;iptables -t nat -D POSTROUTING -s -o $vhost -j MASQUERADE";
$postDown3 = "iptables -F WIREGUARD_DROP_;iptables -D WIREGUARD -o $link -j WIREGUARD_DROP_;iptables -X WIREGUARD_DROP_";
-$postDown26= "ip6tables -t nat -D POSTROUTING -s -o $link -j MASQUERADE";
+$postDown26= "ip6tables -t nat -D POSTROUTING -s -o $link -j MASQUERADE;ip6tables -t nat -D POSTROUTING -s -o $vhost -j MASQUERADE";
$postDown36= "ip6tables -F WIREGUARD_DROP_;ip6tables -D WIREGUARD -o $link -j WIREGUARD_DROP_;ip6tables -X WIREGUARD_DROP_";
$tld = @file_get_contents("$docroot/webGui/include/tld.key")?:'';
@@ -211,39 +212,7 @@ foreach ($vtuns as $wgX) {
}
?>
-
+
+
+ ntfy.sh
+
+ SERVER_URL
+ NTFY_TOKEN
+ TOPIC
+ TITLE
+ MESSAGE
+
+
+
Prowl
diff --git a/emhttp/plugins/dynamix/include/NotificationsArchive.php b/emhttp/plugins/dynamix/include/NotificationsArchive.php
index f77a345fb..d25a719ba 100644
--- a/emhttp/plugins/dynamix/include/NotificationsArchive.php
+++ b/emhttp/plugins/dynamix/include/NotificationsArchive.php
@@ -11,12 +11,13 @@
*/
?>
-$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";
+
// add translations
$_SERVER['REQUEST_URI'] = 'tools';
require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Secure.php";
-require_once "$docroot/webGui/include/Wrappers.php";
$dynamix = parse_plugin_cfg('dynamix',true);
$filter = unscript($_GET['filter']??false);
diff --git a/emhttp/plugins/dynamix/include/Notify.php b/emhttp/plugins/dynamix/include/Notify.php
index a3982e98b..e692b41b0 100644
--- a/emhttp/plugins/dynamix/include/Notify.php
+++ b/emhttp/plugins/dynamix/include/Notify.php
@@ -12,8 +12,9 @@
*/
?>
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
-$notify = "$docroot/webGui/scripts/notify";
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+
+$notify = "$docroot/webGui/scripts/notify";
switch ($_POST['cmd']??'') {
case 'init':
diff --git a/emhttp/plugins/dynamix/include/OpenTerminal.php b/emhttp/plugins/dynamix/include/OpenTerminal.php
index 388bdb906..1b0abdd07 100644
--- a/emhttp/plugins/dynamix/include/OpenTerminal.php
+++ b/emhttp/plugins/dynamix/include/OpenTerminal.php
@@ -11,13 +11,13 @@
*/
?>
-$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";
// add translations
$_SERVER['REQUEST_URI'] = '';
require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Secure.php";
-require_once "$docroot/webGui/include/Wrappers.php";
// Get the webGui configuration preferences
extract(parse_plugin_cfg('dynamix',true));
diff --git a/emhttp/plugins/dynamix/include/PHPsettings.php b/emhttp/plugins/dynamix/include/PHPsettings.php
index 38a20c5dd..15945b8b3 100644
--- a/emhttp/plugins/dynamix/include/PHPsettings.php
+++ b/emhttp/plugins/dynamix/include/PHPsettings.php
@@ -11,7 +11,7 @@
*/
?>
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
switch ($_POST['cmd']??'') {
case 'clear':
diff --git a/emhttp/plugins/dynamix/include/PageBuilder.php b/emhttp/plugins/dynamix/include/PageBuilder.php
index c74a9846f..931d05943 100644
--- a/emhttp/plugins/dynamix/include/PageBuilder.php
+++ b/emhttp/plugins/dynamix/include/PageBuilder.php
@@ -1,6 +1,6 @@
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+
// add translations
$_SERVER['REQUEST_URI'] = '';
require_once "$docroot/webGui/include/Translations.php";
diff --git a/emhttp/plugins/dynamix/include/ProtocolData.php b/emhttp/plugins/dynamix/include/ProtocolData.php
index ae50ab692..3edf9e7d1 100644
--- a/emhttp/plugins/dynamix/include/ProtocolData.php
+++ b/emhttp/plugins/dynamix/include/ProtocolData.php
@@ -11,14 +11,13 @@
*/
?>
-$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";
switch (_var($_GET,'protocol')) {
- case 'smb': $data = @parse_ini_file('state/sec.ini',true) ?: []; break;
- case 'nfs': $data = @parse_ini_file('state/sec_nfs.ini',true) ?: []; break;
+ case 'smb': $data = (array)@parse_ini_file('state/sec.ini',true); break;
+ case 'nfs': $data = (array)@parse_ini_file('state/sec_nfs.ini',true); break;
}
$name = unscript(_var($_GET,'name'));
echo json_encode(_var($data,$name));
diff --git a/emhttp/plugins/dynamix/include/ProvisionCert.php b/emhttp/plugins/dynamix/include/ProvisionCert.php
index bd85e06ae..51b9564d1 100644
--- a/emhttp/plugins/dynamix/include/ProvisionCert.php
+++ b/emhttp/plugins/dynamix/include/ProvisionCert.php
@@ -1,6 +1,6 @@
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
-$certPath = "/boot/config/ssl/certs/certificate_bundle.pem";
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+require_once "$docroot/webGui/include/Wrappers.php";
+
// add translations
$_SERVER['REQUEST_URI'] = 'settings';
require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Wrappers.php";
+$certPath = "/boot/config/ssl/certs/certificate_bundle.pem";
$cli = php_sapi_name()=='cli';
function response_complete($httpcode, $result, $cli_success_msg='') {
@@ -46,9 +47,8 @@ $certPresent = file_exists($certPath);
if ($certPresent) {
// renew existing cert
$certSubject = exec("/usr/bin/openssl x509 -subject -noout -in ".escapeshellarg($certPath));
- $isLegacyCert = preg_match('/.*\.unraid\.net$/', $certSubject);
$isWildcardCert = preg_match('/.*\.myunraid\.net$/', $certSubject);
- if ($isLegacyCert || $isWildcardCert) {
+ if ($isWildcardCert) {
exec("/usr/bin/openssl x509 -checkend 2592000 -noout -in ".escapeshellarg($certPath), $arrout, $retval_expired);
if ($retval_expired === 0) {
// not within 30 days of cert expire date
@@ -59,7 +59,6 @@ if ($certPresent) {
response_complete(406, '{"error":"'._('Cannot renew a custom cert at').' '.$certPath.'"}');
}
}
-$endpoint = ($certPresent && $isLegacyCert) ? "provisioncert" : "provisionwildcard";
$keyfile = empty($var['regFILE']) ? false : @file_get_contents($var['regFILE']);
if ($keyfile === false) {
@@ -67,7 +66,7 @@ if ($keyfile === false) {
}
$keyfile = @base64_encode($keyfile);
-$ch = curl_init("https://keys.lime-technology.com/account/ssl/$endpoint");
+$ch = curl_init("https://keys.lime-technology.com/account/ssl/provisionwildcard");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
diff --git a/emhttp/plugins/dynamix/include/ReplaceKey.php b/emhttp/plugins/dynamix/include/ReplaceKey.php
index 8f28549ed..990e7f269 100644
--- a/emhttp/plugins/dynamix/include/ReplaceKey.php
+++ b/emhttp/plugins/dynamix/include/ReplaceKey.php
@@ -1,5 +1,5 @@
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+require_once "$docroot/webGui/include/Helpers.php";
+extract(parse_plugin_cfg('dynamix',true));
+
// add translations
$_SERVER['REQUEST_URI'] = 'tools';
require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Helpers.php";
-extract(parse_plugin_cfg('dynamix',true));
-
$var = parse_ini_file('state/var.ini');
$keyfile = base64_encode(file_get_contents($var['regFILE']));
?>
diff --git a/emhttp/plugins/dynamix/include/Report.php b/emhttp/plugins/dynamix/include/Report.php
index 8594f2d10..a294f59ac 100644
--- a/emhttp/plugins/dynamix/include/Report.php
+++ b/emhttp/plugins/dynamix/include/Report.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/Secure.php";
require_once "$docroot/webGui/include/Wrappers.php";
@@ -42,7 +41,7 @@ case 'notice':
break;
case 'state':
$pools = explode(',',_var($_POST,'pools'));
- $disks = @parse_ini_file('state/disks.ini',true) ?: [];
+ $disks = (array)@parse_ini_file('state/disks.ini',true);
$error = [];
foreach ($pools as $pool) if (stripos(_var($disks[$pool],'state'),'ERROR:')===0) $error[] = $pool.' - '.str_ireplace('ERROR:','',$disks[$pool]['state']);
echo implode(' ',$error);
diff --git a/emhttp/plugins/dynamix/include/ResetTZ.php b/emhttp/plugins/dynamix/include/ResetTZ.php
new file mode 100644
index 000000000..0fa61182d
--- /dev/null
+++ b/emhttp/plugins/dynamix/include/ResetTZ.php
@@ -0,0 +1,29 @@
+
+
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+
+$scripts = ['update_2','update_3'];
+$pidfile = '/var/run/nchan.pid';
+$nchan = 'webGui/nchan';
+
+if (!is_file($pidfile)) exit;
+
+foreach ($scripts as $script) {
+ if (exec("grep -Pom1 '^$nchan/$script' $pidfile")) {
+ // restart selected script
+ exec("pkill -f $nchan/$script");
+ exec("$docroot/$nchan/$script &>/dev/null &");
+ }
+}
+?>
diff --git a/emhttp/plugins/dynamix/include/RoutingTable.php b/emhttp/plugins/dynamix/include/RoutingTable.php
index 1b61e2933..863925bd4 100644
--- a/emhttp/plugins/dynamix/include/RoutingTable.php
+++ b/emhttp/plugins/dynamix/include/RoutingTable.php
@@ -1,6 +1,6 @@
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+
// add translations
$_SERVER['REQUEST_URI'] = '';
require_once "$docroot/webGui/include/Translations.php";
diff --git a/emhttp/plugins/dynamix/include/Secure.php b/emhttp/plugins/dynamix/include/Secure.php
index 977921efc..d44406762 100644
--- a/emhttp/plugins/dynamix/include/Secure.php
+++ b/emhttp/plugins/dynamix/include/Secure.php
@@ -1,6 +1,6 @@
-$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";
-$shares = @parse_ini_file('state/shares.ini',true) ?: [];
+$shares = (array)@parse_ini_file('state/shares.ini',true);
$name = unscript(_var($_GET,'name'));
echo json_encode(_var($shares,$name));
?>
diff --git a/emhttp/plugins/dynamix/include/ShareList.php b/emhttp/plugins/dynamix/include/ShareList.php
index 72a78e56a..595f0f8fb 100644
--- a/emhttp/plugins/dynamix/include/ShareList.php
+++ b/emhttp/plugins/dynamix/include/ShareList.php
@@ -11,7 +11,12 @@
*/
?>
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+require_once "$docroot/webGui/include/Helpers.php";
+
+// add translations
+$_SERVER['REQUEST_URI'] = 'shares';
+require_once "$docroot/webGui/include/Translations.php";
if (isset($_POST['scan'])) {
die((new FilesystemIterator("/mnt/user/{$_POST['scan']}"))->valid() ? '0' : '1');
@@ -31,11 +36,6 @@ if (isset($_POST['cleanup'])) {
die((string)$n);
}
-// add translations
-$_SERVER['REQUEST_URI'] = 'shares';
-require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Helpers.php";
-
$compute = rawurldecode(_var($_POST,'compute'));
$path = rawurldecode(_var($_POST,'path'));
$all = _var($_POST,'all');
diff --git a/emhttp/plugins/dynamix/include/SmartInfo.php b/emhttp/plugins/dynamix/include/SmartInfo.php
index 679018770..995e27a38 100644
--- a/emhttp/plugins/dynamix/include/SmartInfo.php
+++ b/emhttp/plugins/dynamix/include/SmartInfo.php
@@ -11,7 +11,9 @@
*/
?>
-$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/webGui/include/Preselect.php";
// add translations
$_SERVER['REQUEST_URI'] = 'main';
@@ -19,8 +21,6 @@ require_once "$docroot/webGui/include/Translations.php";
$disks = array_merge_recursive(@parse_ini_file('state/disks.ini',true)?:[], @parse_ini_file('state/devs.ini',true)?:[]);
require_once "$docroot/webGui/include/CustomMerge.php";
-require_once "$docroot/webGui/include/Helpers.php";
-require_once "$docroot/webGui/include/Preselect.php";
function normalize($text, $glue='_') {
$words = explode($glue,$text);
diff --git a/emhttp/plugins/dynamix/include/StartCommand.php b/emhttp/plugins/dynamix/include/StartCommand.php
index 8360103e8..254c41501 100644
--- a/emhttp/plugins/dynamix/include/StartCommand.php
+++ b/emhttp/plugins/dynamix/include/StartCommand.php
@@ -11,7 +11,7 @@
*/
?>
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Secure.php";
function pgrep($proc) {
diff --git a/emhttp/plugins/dynamix/include/SysDevs.php b/emhttp/plugins/dynamix/include/SysDevs.php
index 259b56567..cf5d90905 100644
--- a/emhttp/plugins/dynamix/include/SysDevs.php
+++ b/emhttp/plugins/dynamix/include/SysDevs.php
@@ -11,26 +11,27 @@
*/
?>
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
+require_once "$docroot/webGui/include/Helpers.php";
+
// add translations
$_SERVER['REQUEST_URI'] = 'tools';
require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Helpers.php";
function usb_physical_port($usbbusdev) {
if (preg_match('/^Bus (?P\S+) Device (?P\S+): ID (?P\S+)(?P.*)$/', $usbbusdev, $usbMatch)) {
- //udevadm info -a --name=/dev/bus/usb/003/002 | grep KERNEL==
- $udevcmd = "udevadm info -a --name=/dev/bus/usb/".$usbMatch['bus']."/".$usbMatch['dev']." | grep KERNEL==" ;
- $physical_busid = _("None") ;
+ //udevadm info -a --name=/dev/bus/usb/003/002 | grep KERNEL==
+ $udevcmd = "udevadm info -a --name=/dev/bus/usb/".$usbMatch['bus']."/".$usbMatch['dev']." | grep KERNEL==";
+ $physical_busid = _("None");
exec($udevcmd , $udev);
if (isset($udev)) {
- $physical_busid = trim(substr($udev[0], 13) , '"') ;
+ $physical_busid = trim(substr($udev[0], 13) , '"');
if (substr($physical_busid,0,3) =='usb') {
- $physical_busid = substr($physical_busid,3).'-0' ;
+ $physical_busid = substr($physical_busid,3).'-0';
}
}
}
- return($physical_busid) ;
+ return($physical_busid);
}
switch ($_POST['table']) {
@@ -40,7 +41,7 @@ case 't1':
exec('lspci -n|awk \'{print "["$3"]"}\'',$iommu);
exec('lspci',$lspci);
$i = 0;
- foreach ($lspci as $line) echo "".$iommu[$i++]." $line ";
+ foreach ($lspci as $line) echo "",$iommu[$i++]," $line ";
$noiommu = true;
} else {
$BDF_VD_REGEX = '/^[[:xdigit:]]{2}:[[:xdigit:]]{2}\.[[:xdigit:]](\|[[:xdigit:]]{4}:[[:xdigit:]]{4})?$/';
@@ -103,7 +104,6 @@ case 't1':
}
}
$lines = array_values(array_unique($lines, SORT_STRING));
-
$iommuinuse = array ();
foreach ($lines as $pciinuse){
$string = exec("ls /sys/kernel/iommu_groups/*/devices/$pciinuse -1 -d");
@@ -126,35 +126,35 @@ case 't1':
// By default lspci does not output the when the only domain in the system is 0000. Add it back.
$pciaddress = "0000:".$pciaddress;
}
- echo ($append)?"":"";
+ echo ($append) ? "" : " ";
exec("lspci -v -s $pciaddress", $outputvfio);
if (preg_grep("/vfio-pci/i", $outputvfio)) {
- echo " ";
+ echo " ";
$isbound = "true";
}
echo " ";
if ((strpos($line, 'Host bridge') === false) && (strpos($line, 'PCI bridge') === false)) {
- if (file_exists('/sys/kernel/iommu_groups/'.$iommu.'/devices/'.$pciaddress.'/reset')) echo " ";
+ if (file_exists('/sys/kernel/iommu_groups/'.$iommu.'/devices/'.$pciaddress.'/reset')) echo " ";
echo " ";
- echo in_array($iommu, $iommuinuse) ? ' | or just
echo (in_array($pciaddress."|".$vd, $vfio_cfg_devices) || in_array($pciaddress, $vfio_cfg_devices)) ? " checked>" : ">";
} else { echo " "; }
echo ' '.$line.' ';
+ echo '">',$line,' ';
unset($outputvfio);
switch (true) {
case (strpos($line, 'USB controller') !== false):
if (isset($isbound)) {
- echo ''._('This controller is bound to vfio, connected USB devices are not visible').'. ';
+ echo '',_('This controller is bound to vfio, connected USB devices are not visible'),'. ';
} else {
exec('for usb_ctrl in $(find /sys/bus/usb/devices/usb* -maxdepth 0 -type l);do path="$(realpath "${usb_ctrl}")";if [[ $path == *'.$pciaddress.'* ]];then bus="$(cat "${usb_ctrl}/busnum")";lsusb -s $bus:|sort;fi;done',$getusb);
foreach($getusb as $usbdevice) {
[$bus,$id] = my_explode(':',$usbdevice);
- $usbport = usb_physical_port($usbdevice) ;
+ $usbport = usb_physical_port($usbdevice);
if (strlen($usbport) > 7 ) {$usbport .= "\t"; } else { $usbport .= "\t\t"; }
- echo "$bus Port $usbport".trim($id)." ";
+ echo "$bus Port $usbport",trim($id)," ";
}
unset($getusb);
}
@@ -167,14 +167,14 @@ case 't1':
case (strpos($line, 'Mass storage controller') !== false):
case (strpos($line, 'Non-Volatile memory controller') !== false):
if (isset($isbound)) {
- echo ''._('This controller is bound to vfio, connected drives are not visible').'. ';
+ echo '',_('This controller is bound to vfio, connected drives are not visible'),'. ';
} else {
exec('ls -al /sys/block/sd* /sys/block/hd* /sys/block/sr* /sys/block/nvme* 2>/dev/null | grep -i "'.$pciaddress.'"',$getsata);
foreach($getsata as $satadevice) {
$satadevice = substr($satadevice, strrpos($satadevice, '/', -1)+1);
$search = preg_grep('/'.$satadevice.'.*/', $lsscsi);
foreach ($search as $deviceline) {
- echo ''.$deviceline.' ';
+ echo '',$deviceline,' ';
}
}
unset($search);
@@ -218,15 +218,15 @@ case 't3':
exec('lsusb|sort',$lsusb);
foreach ($lsusb as $line) {
[$bus,$id] = my_explode(':',$line);
- $usbport = usb_physical_port($line) ;
- echo "$bus Port $usbport ".trim($id)." ";
+ $usbport = usb_physical_port($line);
+ echo "$bus Port $usbport ".trim($id)." ";
}
break;
case 't4':
exec('lsscsi -s',$lsscsi);
foreach ($lsscsi as $line) {
if (strpos($line,'/dev/')===false) continue;
- echo "".preg_replace('/\] +/','] ',$line)." ";
+ echo "",preg_replace('/\] +/','] ',$line)," ";
}
break;
}
diff --git a/emhttp/plugins/dynamix/include/SysDrivers.php b/emhttp/plugins/dynamix/include/SysDrivers.php
index 47ac13566..194583063 100644
--- a/emhttp/plugins/dynamix/include/SysDrivers.php
+++ b/emhttp/plugins/dynamix/include/SysDrivers.php
@@ -11,110 +11,109 @@
*/
?>
-$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/webGui/include/SysDriversHelpers.php";
+require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
+
// add translations
$_SERVER['REQUEST_URI'] = 'tools';
require_once "$docroot/webGui/include/Translations.php";
-require_once "$docroot/webGui/include/Helpers.php";
-require_once "$docroot/webGui/include/SysDriversHelpers.php";
-require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
-$kernel = shell_exec("uname -r") ;
-$kernel = trim($kernel,"\n") ;
-$lsmod = shell_exec("lsmod") ;
+$kernel = shell_exec("uname -r");
+$kernel = trim($kernel,"\n");
+$lsmod = shell_exec("lsmod");
$supportpage = true;
-$modtoplgfile = "/tmp/modulestoplg.json" ;
-$sysdrvfile = "/tmp/sysdrivers.json" ;
-$sysdrvinit = "/tmp/sysdrivers.init" ;
-if (!is_file($modtoplgfile) || !is_file($sysdrvfile)) { modtoplg() ; createlist() ;}
-$arrModtoPlg = json_decode(file_get_contents("/tmp/modulestoplg.json") ,TRUE) ;
+$modtoplgfile = "/tmp/modulestoplg.json";
+$sysdrvfile = "/tmp/sysdrivers.json";
+$sysdrvinit = "/tmp/sysdrivers.init";
+if (!is_file($modtoplgfile) || !is_file($sysdrvfile)) { modtoplg(); createlist();}
+$arrModtoPlg = json_decode(file_get_contents("/tmp/modulestoplg.json") ,TRUE);
switch ($_POST['table']) {
-
- case 't1create':
- if (is_file("/tmp/sysdrvbuild.running")) break ;
- touch("/tmp/sysdrvbuild.running") ;
- modtoplg() ;
- createlist() ;
- unlink("/tmp/sysdrvbuild.running") ;
- break;
+case 't1create':
+ if (is_file("/tmp/sysdrvbuild.running")) break;
+ touch("/tmp/sysdrvbuild.running");
+ modtoplg();
+ createlist();
+ unlink("/tmp/sysdrvbuild.running");
+ break;
- case 't1load':
- $list = file_get_contents($sysdrvfile) ;
- $arrModules = json_decode($list,TRUE) ;
- $init = false;
- if (is_file($sysdrvinit)) $init = file_get_contents($sysdrvinit);
- $html = ""._("Driver")." "._("Description")." "._("State")." "._("Type")." "._("Modprobe.d config file")." ";
- $html .= " " ;
-
- if (is_array($arrModules)) ksort($arrModules) ;
- foreach($arrModules as $modname => $module) {
- if ($modname == "") continue ;
+case 't1load':
+ $list = file_get_contents($sysdrvfile);
+ $arrModules = json_decode($list,TRUE);
+ $init = false;
+ if (is_file($sysdrvinit)) $init = file_get_contents($sysdrvinit);
+ $html = ""._('Driver')." "._('Description')." "._('State')." "._('Type')." "._('Modprobe.d config file')." ";
+ $html .= " ";
+ ksort($arrModules);
+ foreach($arrModules as $modname => $module) {
+ if ($modname == "") continue;
+ if (is_file("/boot/config/modprobe.d/$modname.conf")) {
+ $modprobe = file_get_contents("/boot/config/modprobe.d/$modname.conf");
+ $state = strpos($modprobe, "blacklist");
+ $modprobe = explode(PHP_EOL,$modprobe);
+ if($state !== false) {$state = "Disabled";} else $state="Custom";
+ $module['state'] = $state;
+ $module['modprobe'] = $modprobe;
+ } else {
+ if (is_file("/etc/modprobe.d/$modname.conf")) {
+ $modprobe = file_get_contents("/etc/modprobe.d/$modname.conf");
+ $state = strpos($modprobe, "blacklist");
+ $modprobe = explode(PHP_EOL,$modprobe);
+ if($state !== false) {$state = "Disabled";} else $state="System";
+ $module['state'] = $state;
+ $module['modprobe'] = $modprobe;
+ }
+ }
+ $html .= "";
+ if ($supportpage) {
+ if ($module['support'] == false) {
+ $supporthtml = "";
+ } else {
+ $supporturl = $module['supporturl'];
+ $pluginname = $module['plugin'];
+ $supporthtml = " ";
+ }
+ }
+ if (!empty($module["version"])) $version = " (".$module["version"].")"; else $version = "";
+ $html .= "$modname$version$supporthtml ";
+ $html .= "{$module['description']} {$module['state']} {$module['type']} ";
+ $text = "";
+ if (is_array($module["modprobe"]) && count($module["modprobe"])) {
+ $text = implode("\n",$module["modprobe"]);
+ $hidden = ($module['state'] == "System") ? "hidden" : "";
+ $html .= "";
+ $html .= " ";
+ $html .= " ";
+ $html .= " ";
+ $html .= "$text ";
+ } else {
+ $html .= "";
+ $html .= " ";
+ $html .= " ";
+ $html .= " ";
+ $html .= "$text ";
+ }
+ }
+ $html .= " ";
+ $rtn = array();
+ $rtn['html'] = $html;
+ if ($init !== false) {$init = true; unlink($sysdrvinit);}
+ $rtn['init'] = $init;
+ echo json_encode($rtn);
+ break;
- if (is_file("/boot/config/modprobe.d/$modname.conf")) {
- $modprobe = file_get_contents("/boot/config/modprobe.d/$modname.conf") ;
- $state = strpos($modprobe, "blacklist");
- $modprobe = explode(PHP_EOL,$modprobe) ;
- if($state !== false) {$state = "Disabled" ;} else $state="Custom" ;
- $module['state'] = $state ;
- $module['modprobe'] = $modprobe ;
- } else {
- if (is_file("/etc/modprobe.d/$modname.conf")) {
- $modprobe = file_get_contents("/etc/modprobe.d/$modname.conf") ;
- $state = strpos($modprobe, "blacklist");
- $modprobe = explode(PHP_EOL,$modprobe) ;
- if($state !== false) {$state = "Disabled" ;} else $state="System" ;
- $module['state'] = $state ;
- $module['modprobe'] = $modprobe ;
- }
- }
-
- $html .= "" ;
- if ($supportpage) {
- if ($module['support'] == false) {
- $supporthtml = "" ;
- } else {
- $supporturl = $module['supporturl'] ;
- $pluginname = $module['plugin'] ;
- $supporthtml = " " ;
- }
- }
- $html .= "$modname$supporthtml " ;
- $html .= "{$module['description']} {$module['state']} {$module['type']} ";
-
- $text = "" ;
- if (is_array($module["modprobe"])) {
- $text = implode("\n",$module["modprobe"]) ;
- $html .= " " ;
- $hidden = "" ;
- if ($module['state'] == "System") $hidden = "hidden" ;
- $html .= " " ;
- $html .= "$text ";
- } else {
- $html .= " " ;
- $html .= " " ;
- $html .= "$text ";
- }
-
- }
- $html .= " " ;
- $rtn = array() ;
- $rtn['html'] = $html ;
- if ($init !== false) {$init = true ; unlink($sysdrvinit) ;}
- $rtn['init'] = $init ;
- echo json_encode($rtn) ;
- break;
-
case "update":
- $conf = $_POST['conf'] ;
- $module = $_POST['module'] ;
- if ($conf == "") $error = unlink("/boot/config/modprobe.d/$module.conf") ; else $error = file_put_contents("/boot/config/modprobe.d/$module.conf",$conf) ;
- getmodules($module) ;
- $return = $arrModules[$module] ;
- $return['supportpage'] = $supportpage ;
- if (is_array($return["modprobe"]))$return["modprobe"] = implode("\n",$return["modprobe"]) ;
- if ($error !== false) $return["error"] = false ; else $return["error"] = true ;
- echo json_encode($return) ;
- break ;
-}
+ $conf = $_POST['conf'];
+ $module = $_POST['module'];
+ if ($conf == "") $error = unlink("/boot/config/modprobe.d/$module.conf"); else $error = file_put_contents("/boot/config/modprobe.d/$module.conf",$conf);
+ getmodules($module);
+ $return = $arrModules[$module];
+ $return['supportpage'] = $supportpage;
+ if (is_array($return["modprobe"]))$return["modprobe"] = implode("\n",$return["modprobe"]);
+ if ($error !== false) $return["error"] = false; else $return["error"] = true;
+ echo json_encode($return);
+ break;
+}
?>
diff --git a/emhttp/plugins/dynamix/include/SysDriversHelpers.php b/emhttp/plugins/dynamix/include/SysDriversHelpers.php
index b85f01cf4..8374a1551 100644
--- a/emhttp/plugins/dynamix/include/SysDriversHelpers.php
+++ b/emhttp/plugins/dynamix/include/SysDriversHelpers.php
@@ -12,167 +12,149 @@
function getplugin($in) {
- $plugins = "/var/log/plugins/";
- $plugin_link = $plugins.$in ;
- $plugin_file = @readlink($plugin_link);
- $support = plugin('support',$plugin_file) ?: "";
- return($support) ;
+ $plugins = "/var/log/plugins/";
+ $plugin_link = $plugins.$in;
+ $plugin_file = @readlink($plugin_link);
+ return plugin('support',$plugin_file) ?: '';
}
-function getmodules($line) {
- global $arrModules,$lsmod,$kernel,$arrModtoPlg,$modplugins ;
- $modprobe = "" ;
- $desc = $file = $pluginfile = $option = $filename = $depends = $support = $supporturl = $dir = $state = null ;
- $name = $line ;
- $modname = shell_exec("modinfo $name > /dev/null") ;
- if ($modname != null) $modname = trim($modname,"\n") ;
- $output=null ;
- exec("modinfo $name",$output,$error) ;
- $parms = array() ;
- foreach($output as $outline) {
- $data = explode(":",$outline) ;
- $support = false ; $supporturl = null ;
- switch ($data[0])
- {
- case "name":
- $modname = trim($data[1]) ;
- break ;
- case "depends":
- $depends = trim($data[1]) ;
- break ;
- case "filename":
- $filename = trim($data[1]) ;
- break ;
- case "description":
- $desc = trim($data[1]) ;
- break ;
- case "parm":
- $parms[] = trim(str_replace("parm:","",$outline)) ;
- break ;
- case "file":
- $file = trim(str_replace("file:","",$outline)) ;
- break ;
- case "alias":
- case "author":
- case "firmware":
- case "intree":
- case "vermagic":
- case "retpoline":
- case "import_ns":
- case "license":
- break ;
- default:
- $parms[] = trim($outline) ;
- break ;
+function getmodules($name) {
+ global $arrModules,$lsmod,$kernel,$arrModtoPlg,$modplugins;
+ // preset variables
+ $modname = $depends = $filename = $desc = $file = $version = $state = $dir = $support = $supporturl = $pluginfile = null;
+ $modprobe = $parms = [];
+ exec("modinfo $name",$output,$error);
+ foreach($output as $outline) {
+ if (!$outline) continue;
+ [$key,$data] = array_pad(explode(':',$outline,2),2,'');
+ $data = trim($data);
+ switch ($key) {
+ case "name":
+ $modname = $data;
+ break;
+ case "depends":
+ $depends = $data;
+ break;
+ case "filename":
+ $filename = $data;
+ break;
+ case "description":
+ $desc = $data;
+ break;
+ case "parm":
+ $parms[] = $data;
+ break;
+ case "file":
+ $file = $data;
+ break;
+ case "version":
+ $version = $data;
+ break;
+ case "alias":
+ case "author":
+ case "firmware":
+ case "intree":
+ case "vermagic":
+ case "retpoline":
+ case "import_ns":
+ case "license":
+ // ignore
+ break;
+ default:
+ $parms[] = trim($outline);
+ break;
}
-}
-if ($modname != null) {
- if (strpos($lsmod, $modname,0)) $state = "Inuse" ; else $state = "Available";
- if (isset($arrModtoPlg[$modname])) { $support = true ; $supporturl = plugin("support", $modplugins[$arrModtoPlg[$modname]]) ; $pluginfile = "Plugin name: {$arrModtoPlg[$modname]}" ; } else { $support = false ; $supporturl = null ; }
+ }
+ if ($modname) {
+ $state = strpos($lsmod,$modname)!==false ? "Inuse" : "Available";
+ if (isset($arrModtoPlg[$modname])) {
+ $support = true;
+ $supporturl = plugin("support", $modplugins[$arrModtoPlg[$modname]]);
+ $pluginfile = "Plugin name: {$arrModtoPlg[$modname]}" ;
}
-if (is_file("/boot/config/modprobe.d/$modname.conf")) {
- $modprobe = file_get_contents("/boot/config/modprobe.d/$modname.conf") ;
- $state = strpos($modprobe, "blacklist");
- $modprobe = explode(PHP_EOL,$modprobe) ;
- if($state !== false) {$state = "Disabled" ;}
- else $state="Custom" ;
- } else {
- if (is_file("/etc/modprobe.d/$modname.conf")) {
- $modprobe = file_get_contents("/etc/modprobe.d/$modname.conf") ;
- $state = strpos($modprobe, "blacklist");
- $modprobe = explode(PHP_EOL,$modprobe) ;
- if($state !== false) {$state = "Disabled" ;} else $state="System" ;
- $module['state'] = $state ;
- $module['modprobe'] = $modprobe ;
- }
- }
-
-if ($filename != "(builtin)") {
-if ($filename != null) {
-$type = pathinfo($filename) ;
-$dir = $type['dirname'] ;
-
-$dir = str_replace("/lib/modules/$kernel/kernel/drivers/", "" ,$dir) ;
-$dir = str_replace("/lib/modules/$kernel/kernel/", "" ,$dir) ;
-}
-} else {
- $dir = $file ;
- $dir = str_replace("drivers/", "" ,$dir) ;
- if ($state == "Inuse") $state= "Kernel - Inuse"; else $state="Kernel" ;
-}
-if ($desc != null) $description = substr($desc , 0 ,60) ; else $description = null ;
-$arrModules[$modname] = [
- 'modname' => $modname,
- 'dependacy' => $depends,
- 'parms' => $parms,
- 'file' => $file,
- 'modprobe' => $modprobe,
- 'plugin' => $pluginfile ,
- 'state' => $state,
- 'type' => $dir,
- 'support' => $support,
- 'supporturl' => $supporturl,
- 'description' => $description ,
-] ;
+ }
+ if (is_file("/boot/config/modprobe.d/$modname.conf")) {
+ $modprobe = file_get_contents("/boot/config/modprobe.d/$modname.conf");
+ $state = strpos($modprobe,"blacklist")!==false ? "Disabled" : "Custom";
+ $modprobe = explode(PHP_EOL,$modprobe);
+ } elseif (is_file("/etc/modprobe.d/$modname.conf")) {
+ $modprobe = file_get_contents("/etc/modprobe.d/$modname.conf");
+ $state = strpos($modprobe, "blacklist")!==false ? "Disabled" : "System";
+ $modprobe = explode(PHP_EOL,$modprobe);
+ $module['state'] = $state;
+ $module['modprobe'] = $modprobe;
+ }
+ if ($filename != "(builtin)") {
+ if ($filename) {
+ $type = pathinfo($filename);
+ $dir = str_replace("/lib/modules/$kernel/kernel/drivers/", "", $type['dirname']);
+ $dir = str_replace("/lib/modules/$kernel/kernel/", "", $dir);
+ }
+ } else {
+ $dir = str_replace("drivers/", "", $file);
+ $state = ($state=="Inuse") ? "Kernel - Inuse" : "Kernel";
+ }
+ $arrModules[$modname] = [
+ 'modname' => $modname,
+ 'dependacy' => $depends,
+ 'version' => $version,
+ 'parms' => $parms,
+ 'file' => $file,
+ 'modprobe' => $modprobe,
+ 'plugin' => $pluginfile,
+ 'state' => $state,
+ 'type' => $dir,
+ 'support' => $support,
+ 'supporturl' => $supporturl,
+ 'description' => $desc
+ ];
}
function modtoplg() {
- global $modtoplgfile,$kernel ;
-
- $files = array();
- $kernelsplit = explode('-',$kernel) ;
- $kernelvers = trim($kernelsplit[0],"\n") ;
-
- $list = array() ;
- $files = glob('/boot/config/plugins/*/packages/' . $kernelvers . '/*.{txz,tgz}', GLOB_BRACE);
- foreach ($files as $f) {
- $plugin = str_replace("/boot/config/plugins/", "", $f) ;
- $plugin = substr($plugin,0,strpos($plugin,'/') ) ;
- $tar = [] ;
- exec("tar -tf $f | grep -E '.ko.xz|.ko' ",$tar) ;
- foreach ($tar as $t) {
- $p = pathinfo($t) ;
- $filename = str_replace(".ko","",$p["filename"]) ;
- $list[$filename] = $plugin ;
- }
- }
-
- file_put_contents($modtoplgfile,json_encode($list,JSON_PRETTY_PRINT)) ;
-
+ global $modtoplgfile,$kernel;
+ $files = $list = [];
+ $kernelsplit = explode('-',$kernel);
+ $kernelvers = trim($kernelsplit[0],"\n");
+ $files = glob('/boot/config/plugins/*/packages/'.$kernelvers.'/*.{txz,tgz}', GLOB_BRACE);
+ foreach ($files as $f) {
+ $plugin = str_replace("/boot/config/plugins/", "", $f);
+ $plugin = substr($plugin,0,strpos($plugin,'/') );
+ $tar = [];
+ exec("tar -tf $f | grep -E '.ko.xz|.ko' ",$tar);
+ foreach ($tar as $t) {
+ $p = pathinfo($t);
+ $filename = str_replace(".ko","",$p["filename"]);
+ $list[$filename] = $plugin;
+ }
+ }
+ file_put_contents($modtoplgfile,json_encode($list,JSON_PRETTY_PRINT));
}
function createlist() {
- global $modtoplgfile, $sysdrvfile, $lsmod, $kernel,$arrModules, $modplugins,$arrModtoPlg ;
- $arrModtoPlg = json_decode(file_get_contents($modtoplgfile) ,TRUE) ;
- $builtinmodules = file_get_contents("/lib/modules/$kernel/modules.builtin") ;
- $builtinmodules = explode(PHP_EOL,$builtinmodules) ;
- $procmodules =file_get_contents("/lib/modules/$kernel/modules.order") ;
- $procmodules = explode(PHP_EOL,$procmodules) ;
- $arrModules = array() ;
-
- $list = scandir('/var/log/plugins/') ;
- foreach($list as $f) $modplugins[plugin("name" , @readlink("/var/log/plugins/$f"))] = @readlink("/var/log/plugins/$f") ;
-
- foreach($builtinmodules as $bultin)
- {
- if ($bultin == "") continue ;
- getmodules(pathinfo($bultin)["filename"]) ;
- }
-
- foreach($procmodules as $line) {
- if ($line == "") continue ;
- getmodules(pathinfo($line)["filename"]) ;
- }
-
- $lsmod2 = explode(PHP_EOL,$lsmod) ;
- foreach($lsmod2 as $line) {
- if ($line == "") continue ;
- $line2 = explode(" ",$line) ;
- getmodules($line2['0']) ;
- }
-
- unset($arrModules['null']);
- file_put_contents($sysdrvfile,json_encode($arrModules,JSON_PRETTY_PRINT)) ;
+ global $modtoplgfile, $sysdrvfile, $lsmod, $kernel,$arrModules, $modplugins,$arrModtoPlg;
+ $arrModtoPlg = json_decode(file_get_contents($modtoplgfile) ,TRUE);
+ $builtinmodules = file_get_contents("/lib/modules/$kernel/modules.builtin");
+ $builtinmodules = explode(PHP_EOL,$builtinmodules);
+ $procmodules =file_get_contents("/lib/modules/$kernel/modules.order");
+ $procmodules = explode(PHP_EOL,$procmodules);
+ $arrModules = [];
+ $list = scandir('/var/log/plugins/');
+ foreach($list as $f) $modplugins[plugin("name" , @readlink("/var/log/plugins/$f"))] = @readlink("/var/log/plugins/$f");
+ foreach($builtinmodules as $bultin) {
+ if (!$bultin) continue;
+ getmodules(pathinfo($bultin)["filename"]);
+ }
+ foreach($procmodules as $line) {
+ if (!$line) continue;
+ getmodules(pathinfo($line)["filename"]);
+ }
+ $lsmod2 = explode(PHP_EOL,$lsmod);
+ foreach($lsmod2 as $line) {
+ if (!$line) continue;
+ $line2 = explode(" ",$line);
+ getmodules($line2['0']);
+ }
+ unset($arrModules['null']);
+ file_put_contents($sysdrvfile,json_encode($arrModules,JSON_PRETTY_PRINT));
}
-
-?>
\ No newline at end of file
+?>
diff --git a/emhttp/plugins/dynamix/include/SysDriversInit.php b/emhttp/plugins/dynamix/include/SysDriversInit.php
index f9a5c3971..1beae8711 100755
--- a/emhttp/plugins/dynamix/include/SysDriversInit.php
+++ b/emhttp/plugins/dynamix/include/SysDriversInit.php
@@ -1,5 +1,5 @@
#!/usr/bin/php
-
\ No newline at end of file
+$modtoplgfile = "/tmp/modulestoplg.json";
+$sysdrvfile = "/tmp/sysdrivers.json";
+$arrModtoPlg = json_decode(file_get_contents("/tmp/modulestoplg.json") ,TRUE);
+file_put_contents("/tmp/sysdrivers.init","1");
+
+SysDriverslog("SysDrivers Build Starting");
+modtoplg();
+createlist();
+SysDriverslog("SysDrivers Build Complete");
+?>
diff --git a/emhttp/plugins/dynamix/include/Syslog.php b/emhttp/plugins/dynamix/include/Syslog.php
index 72fcaf814..32b7f3a5a 100644
--- a/emhttp/plugins/dynamix/include/Syslog.php
+++ b/emhttp/plugins/dynamix/include/Syslog.php
@@ -1,6 +1,6 @@
-$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
+$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/ColorCoding.php";
array_multisort(array_map('filemtime',($logs = glob($_POST['log'].'*',GLOB_NOSORT))),SORT_ASC,$logs);
diff --git a/emhttp/plugins/dynamix/include/Templates.php b/emhttp/plugins/dynamix/include/Templates.php
index 5e2abdfaa..2d827c0c8 100644
--- a/emhttp/plugins/dynamix/include/Templates.php
+++ b/emhttp/plugins/dynamix/include/Templates.php
@@ -10,51 +10,9 @@
* all copies or substantial portions of the Software.
*/
?>
-
-$dfm['hover'] = in_array($theme,['white','azure']) ? 'rgba(0,0,0,0.1)' : 'rgba(255,255,255,0.1)';
-$dfm['bgcolor'] = in_array($theme,['white','azure']) ? '#f2f2f2' : '#1c1c1c';
-$dfm['fgcolor'] = in_array($theme,['white','azure']) ? '#1c1c1c' : '#f2f2f2';
-$dfm['incolor'] = $theme!='gray' ? $dfm['bgcolor'] : '#121510';
-?>
">
">
-
-