mirror of
https://github.com/unraid/webgui.git
synced 2026-05-06 12:21:34 -05:00
Merge pull request #76 from bergware/master
Incorporate all enhancements of "bleeding edge"
This commit is contained in:
@@ -22,7 +22,7 @@ function getUPSstatus() {
|
||||
$('#ups_summary').html(data[0]);
|
||||
$('#ups_status').html(data[1]);
|
||||
}
|
||||
<?if (($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0))):?>
|
||||
<?if ($update):?>
|
||||
setTimeout(getUPSstatus,<?=max(abs($display['refresh']),15000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
@@ -32,5 +32,5 @@ $(getUPSstatus);
|
||||
|
||||
<table class="tablesorter shift">
|
||||
<thead><tr><th style="width:15%">Key</th><th style="width:35%">Value</th><th style="width:15%">Key</th><th style="width:35%">Value</th></tr></thead>
|
||||
<tbody id="ups_status"><tr><td colspan="4"><center><i class="fa fa-spinner fa-spin icon"></i><em>Please wait, retrieving UPS information...</em></center></td></tr></tbody>
|
||||
<tbody id="ups_status"><tr><td colspan="4" style="text-align:center"><i class="fa fa-spinner fa-spin icon"></i><em>Please wait, retrieving UPS information...</em></td></tr></tbody>
|
||||
</table>
|
||||
|
||||
@@ -23,7 +23,7 @@ table.ups tbody tr td{padding-left:10px;font-weight:bold;}
|
||||
function getUPSstatus() {
|
||||
$.get('/plugins/dynamix.apcupsd/include/UPSstatus.php',{all:'false'},function(data) {
|
||||
if (data) $('#ups_summary').html(data);
|
||||
<?if (($display['refresh']>0 || ($display['refresh']<0 && $var['mdResync']==0))):?>
|
||||
<?if ($update):?>
|
||||
setTimeout(getUPSstatus, <?=max(abs($display['refresh']),15000)?>);
|
||||
<?endif;?>
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ $green = "class='green-text'";
|
||||
$orange = "class='orange-text'";
|
||||
$status = array_fill(0,6,"<td>-</td>");
|
||||
$all = $_GET['all']=='true';
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
if (file_exists("/var/run/apcupsd.pid")) {
|
||||
exec("/sbin/apcaccess 2>/dev/null", $rows);
|
||||
@@ -62,7 +62,7 @@ if (file_exists("/var/run/apcupsd.pid")) {
|
||||
if ($all && count($rows)%2==1) $result[] = "<td></td><td></td></tr>";
|
||||
if ($power && $load) $status[4] = ($load>=90 ? "<td $red>" : "<td $green>").intval($power*$load/100)." Watts</td>";
|
||||
}
|
||||
if ($all && !$rows) $result[] = "<tr><td colspan='4'><center>No information available</center></td></tr>";
|
||||
if ($all && !$rows) $result[] = "<tr><td colspan='4' style='text-align:center'>No information available</td></tr>";
|
||||
|
||||
echo "<tr>".implode('', $status)."</tr>";
|
||||
if ($all) echo "\n".implode('', $result);
|
||||
|
||||
@@ -18,5 +18,5 @@ Markdown="false"
|
||||
<span class="toggleMode" onclick="toggleMode();"><i id="toggleMode" class="fa fa-lg"></i> Advanced View</span>
|
||||
</div>
|
||||
<?PHP
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php');
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/CreateDocker.php";
|
||||
?>
|
||||
@@ -17,14 +17,14 @@ Markdown="false"
|
||||
?>
|
||||
<?
|
||||
// Add the Docker JSON client
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
$DockerClient = new DockerClient();
|
||||
$DockerUpdate = new DockerUpdate();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
?>
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.ui.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
|
||||
<style>
|
||||
body {-webkit-overflow-scrolling: touch;}
|
||||
img.started{opacity:1.0;}
|
||||
@@ -207,7 +207,6 @@ img.stopped{opacity:0.3;}
|
||||
<input type="button" onclick="reloadUpdate()" value="Check for Updates"/>
|
||||
|
||||
<script src="/webGui/javascript/jquery.switchbutton.js"></script>
|
||||
<script src="/webGui/javascript/context.js"></script>
|
||||
<script src="/plugins/dynamix.docker.manager/javascript/docker.js"></script>
|
||||
<script>
|
||||
<?if ($display['resize']):?>
|
||||
|
||||
@@ -16,7 +16,7 @@ Cond="(pgrep('docker')!==false)"
|
||||
?>
|
||||
<?
|
||||
// Add the Docker JSON client
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
// Repos file
|
||||
$template_repos = $dockerManPaths['template-repos'];
|
||||
|
||||
@@ -17,7 +17,8 @@ Markdown="false"
|
||||
?>
|
||||
<?
|
||||
// Add the Docker JSON client
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php');
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
$docker = new DockerClient();
|
||||
$DockerUpdate = new DockerUpdate();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
@@ -163,7 +164,7 @@ if (file_exists($realfile)) {
|
||||
</dl>
|
||||
|
||||
<form method="POST" action="/update.php" target="progressFrame">
|
||||
<?exec("/usr/local/emhttp/webGui/scripts/btrfs_scrub status /var/lib/docker", $scrub_status, $retval);?>
|
||||
<?exec("$docroot/webGui/scripts/btrfs_scrub status /var/lib/docker", $scrub_status, $retval);?>
|
||||
|
||||
<dl>
|
||||
<dt>btrfs scrub status:</dt>
|
||||
|
||||
@@ -18,5 +18,5 @@ Markdown="false"
|
||||
<span class="toggleMode" onclick="toggleMode();"><i id="toggleMode" class="fa fa-lg"></i> Advanced View</span>
|
||||
</div>
|
||||
<?PHP
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php');
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/CreateDocker.php";
|
||||
?>
|
||||
@@ -13,8 +13,12 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = @$docroot ?: $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
ignore_user_abort(true);
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
$DockerClient = new DockerClient();
|
||||
$DockerUpdate = new DockerUpdate();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
@@ -473,7 +477,7 @@ if (isset($_POST['contName'])) {
|
||||
// Get the command line
|
||||
list($cmd, $Name, $Repository) = xmlToCommand($postXML, $create_paths);
|
||||
|
||||
readfile("/usr/local/emhttp/plugins/dynamix.docker.manager/log.htm");
|
||||
readfile("$docroot/plugins/dynamix.docker.manager/log.htm");
|
||||
@flush();
|
||||
|
||||
// Saving the generated configuration file.
|
||||
@@ -492,8 +496,8 @@ if (isset($_POST['contName'])) {
|
||||
echo "<pre>".htmlentities($postXML)."</pre>";
|
||||
echo "<h2>COMMAND:</h2>";
|
||||
echo "<pre>".htmlentities($cmd)."</pre>";
|
||||
echo "<center><input type='button' value='Back' onclick='window.location=window.location.pathname+window.location.hash+\"?xmlTemplate=edit:${filename}\"'>";
|
||||
echo "<input type='button' value='Done' onclick='done()'></center><br>";
|
||||
echo "<div style='text-align:center'><input type='button' value='Back' onclick='window.location=window.location.pathname+window.location.hash+\"?xmlTemplate=edit:${filename}\"'>";
|
||||
echo "<input type='button' value='Done' onclick='done()'></div><br>";
|
||||
goto END;
|
||||
}
|
||||
|
||||
@@ -501,7 +505,7 @@ if (isset($_POST['contName'])) {
|
||||
if (!$DockerClient->doesImageExist($Repository)) {
|
||||
// Pull image
|
||||
if (!pullImage($Name, $Repository)) {
|
||||
echo '<center><input type="button" value="Done" onclick="done()"></center><br>';
|
||||
echo '<div style="text-align:center"><input type="button" value="Done" onclick="done()"></div><br>';
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
@@ -546,7 +550,7 @@ if (isset($_POST['contName'])) {
|
||||
$_GET['cmd'] = $cmd;
|
||||
include($dockerManPaths['plugin'] . "/include/Exec.php");
|
||||
|
||||
echo '<center><input type="button" value="Done" onclick="done()"></center><br>';
|
||||
echo '<div style="text-align:center"><input type="button" value="Done" onclick="done()"></div><br>';
|
||||
goto END;
|
||||
}
|
||||
|
||||
@@ -554,7 +558,7 @@ if (isset($_POST['contName'])) {
|
||||
## UPDATE CONTAINER
|
||||
##
|
||||
if ($_GET['updateContainer']){
|
||||
readfile("/usr/local/emhttp/plugins/dynamix.docker.manager/log.htm");
|
||||
readfile("$docroot/plugins/dynamix.docker.manager/log.htm");
|
||||
@flush();
|
||||
|
||||
foreach ($_GET['ct'] as $value) {
|
||||
@@ -602,7 +606,7 @@ if ($_GET['updateContainer']){
|
||||
}
|
||||
}
|
||||
|
||||
echo '<center><input type="button" value="Done" onclick="window.parent.jQuery(\'#iframe-popup\').dialog(\'close\');"></center><br>';
|
||||
echo '<div style="text-align:center"><input type="button" value="Done" onclick="window.parent.jQuery(\'#iframe-popup\').dialog(\'close\');"></div><br>';
|
||||
goto END;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
$dockerManPaths = [
|
||||
'plugin' => '/usr/local/emhttp/plugins/dynamix.docker.manager',
|
||||
@@ -26,11 +27,11 @@ $dockerManPaths = [
|
||||
|
||||
#load emhttp variables if needed.
|
||||
if (!isset($var)) {
|
||||
if (!is_file("/usr/local/emhttp/state/var.ini")) shell_exec("wget -qO /dev/null localhost:$(lsof -nPc emhttp | grep -Po 'TCP[^\d]*\K\d+')");
|
||||
$var = @parse_ini_file("/usr/local/emhttp/state/var.ini");
|
||||
if (!is_file("$docroot/state/var.ini")) shell_exec("wget -qO /dev/null localhost:$(lsof -nPc emhttp | grep -Po 'TCP[^\d]*\K\d+')");
|
||||
$var = @parse_ini_file("$docroot/state/var.ini");
|
||||
}
|
||||
if (!isset($eth0) && is_file("/usr/local/emhttp/state/network.ini")) {
|
||||
extract(parse_ini_file('/usr/local/emhttp/state/network.ini',true));
|
||||
if (!isset($eth0) && is_file("$docroot/state/network.ini")) {
|
||||
extract(parse_ini_file("$docroot/state/network.ini",true));
|
||||
}
|
||||
|
||||
// Docker configuration file - guaranteed to exist
|
||||
@@ -354,7 +355,7 @@ class DockerTemplates {
|
||||
|
||||
|
||||
public function getIcon($Repository) {
|
||||
global $dockerManPaths;
|
||||
global $docroot, $dockerManPaths;
|
||||
|
||||
$imgUrl = $this->getTemplateValue($Repository, "Icon");
|
||||
|
||||
@@ -369,8 +370,7 @@ class DockerTemplates {
|
||||
}
|
||||
@copy($storagePath, $tempPath);
|
||||
}
|
||||
|
||||
return (is_file($tempPath)) ? str_replace('/usr/local/emhttp', '', $tempPath) : "";
|
||||
return (is_file($tempPath)) ? str_replace($docroot, '', $tempPath) : "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,12 +778,12 @@ class DockerClient {
|
||||
|
||||
|
||||
public function removeContainer($id) {
|
||||
global $dockerManPaths;
|
||||
global $docroot, $dockerManPaths;
|
||||
// Purge cached container information
|
||||
$info = DockerUtil::loadJSON($dockerManPaths['webui-info']);
|
||||
if (isset($info[$id])) {
|
||||
if (isset($info[$id]['icon'])) {
|
||||
$iconRam = '/usr/local/emhttp'.$info[$id]['icon'];
|
||||
$iconRam = $docroot.$info[$id]['icon'];
|
||||
$iconFlash = str_replace($dockerManPaths['images-ram'], $dockerManPaths['images-storage'], $iconRam);
|
||||
if (is_file($iconRam)) {
|
||||
unlink($iconRam);
|
||||
|
||||
@@ -11,7 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
$DockerClient = new DockerClient();
|
||||
|
||||
$_REQUEST = array_merge($_GET, $_POST);
|
||||
@@ -62,9 +65,9 @@ switch ($action) {
|
||||
if ($container) {
|
||||
$since = array_key_exists('since', $_REQUEST) ? $_REQUEST['since'] : '';
|
||||
$title = array_key_exists('title', $_REQUEST) ? $_REQUEST['title'] : '';
|
||||
require_once '/usr/local/emhttp/webGui/include/ColorCoding.php';
|
||||
require_once "$docroot/webGui/include/ColorCoding.php";
|
||||
if (!$since) {
|
||||
readfile("/usr/local/emhttp/plugins/dynamix.docker.manager/log.htm");
|
||||
readfile("$docroot/plugins/dynamix.docker.manager/log.htm");
|
||||
echo "<script>document.title = '$title';</script>";
|
||||
echo "<script>addLog('".addslashes("<p style='text-align:center'><span class='error label'>Error</span><span class='warn label'>Warning</span><span class='system label'>System</span><span class='array label'>Array</span><span class='login label'>Login</span></p>")."');</script>";
|
||||
$tail = 350;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
if ( isset( $_GET['cmd'] )) {
|
||||
$command = urldecode(($_GET['cmd']));
|
||||
$descriptorspec = [
|
||||
@@ -20,7 +22,7 @@ if ( isset( $_GET['cmd'] )) {
|
||||
];
|
||||
|
||||
$parts = explode(" ", $command);
|
||||
$command = escapeshellcmd(realpath($_SERVER['DOCUMENT_ROOT'].array_shift($parts)));
|
||||
$command = escapeshellcmd(realpath($docroot.array_shift($parts)));
|
||||
if (!$command) return;
|
||||
$command .= " ".implode(" ", $parts); // should add 'escapeshellarg' here, but this requires changes in all the original arguments
|
||||
$id = mt_rand();
|
||||
@@ -31,7 +33,7 @@ if ( isset( $_GET['cmd'] )) {
|
||||
echo "<p class=\"logLine\" id=\"logBody\"></p></fieldset>');</script>";
|
||||
echo "<script>show_Wait({$id});</script>";
|
||||
@flush();
|
||||
$proc = proc_open($command." 2>&1", $descriptorspec, $pipes, '/', array());
|
||||
$proc = proc_open($command." 2>&1", $descriptorspec, $pipes, '/', []);
|
||||
while ($out = fgets( $pipes[1] )) {
|
||||
$out = preg_replace("%[\t\n\x0B\f\r]+%", '', $out );
|
||||
@flush();
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once("/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php");
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
// Autostart file
|
||||
global $dockerManPaths;
|
||||
@@ -22,27 +23,27 @@ $template_repos = $dockerManPaths['template-repos'];
|
||||
if ($_POST['action'] == "autostart" ){
|
||||
$json = ($_POST['response'] == 'json') ? true : false;
|
||||
|
||||
if (! $json) readfile("/usr/local/emhttp/update.htm");
|
||||
if (!$json) readfile("$docroot/update.htm");
|
||||
|
||||
$container = urldecode(($_POST['container']));
|
||||
unset($_POST['container']);
|
||||
|
||||
$allAutoStart = @file($autostart_file, FILE_IGNORE_NEW_LINES);
|
||||
if ($allAutoStart===FALSE) $allAutoStart = array();
|
||||
if ($allAutoStart===FALSE) $allAutoStart = [];
|
||||
$key = array_search($container, $allAutoStart);
|
||||
if ($key===FALSE) {
|
||||
array_push($allAutoStart, $container);
|
||||
if ($json) echo json_encode(array( 'autostart' => true ));
|
||||
if ($json) echo json_encode(['autostart' => true]);
|
||||
}
|
||||
else {
|
||||
unset($allAutoStart[$key]);
|
||||
if ($json) echo json_encode(array( 'autostart' => false ));
|
||||
if ($json) echo json_encode(['autostart' => false]);
|
||||
}
|
||||
file_put_contents($autostart_file, implode(PHP_EOL, $allAutoStart).(count($allAutoStart)? PHP_EOL : ""));
|
||||
}
|
||||
|
||||
if ($_POST['#action'] == "templates" ){
|
||||
readfile("/usr/local/emhttp/update.htm");
|
||||
readfile("$docroot/update.htm");
|
||||
$repos = $_POST['template_repos'];
|
||||
file_put_contents($template_repos, $repos);
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
@@ -50,6 +51,6 @@ if ($_POST['#action'] == "templates" ){
|
||||
}
|
||||
|
||||
if ( isset($_GET['is_dir'] )) {
|
||||
echo json_encode( array( 'is_dir' => is_dir( $_GET['is_dir'] )));
|
||||
echo json_encode(['is_dir' => is_dir($_GET['is_dir'])]);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -12,10 +12,13 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
exec("pgrep docker", $pid);
|
||||
if (count($pid) == 1) exit(0);
|
||||
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
|
||||
$DockerClient = new DockerClient();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
|
||||
@@ -32,8 +35,8 @@ if (!isset($check)) {
|
||||
$DockerTemplates->getAllInfo(true);
|
||||
echo " Done.";
|
||||
} else {
|
||||
require_once '/usr/local/emhttp/webGui/include/Wrappers.php';
|
||||
$notify = "/usr/local/emhttp/webGui/scripts/notify";
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
$notify = "$docroot/webGui/scripts/notify";
|
||||
$unraid = parse_plugin_cfg("dynamix",true);
|
||||
$server = strtoupper($var['NAME']);
|
||||
$output = $unraid['notify']['docker_notify'];
|
||||
@@ -43,7 +46,7 @@ if (!isset($check)) {
|
||||
$name = $ct['Name'];
|
||||
$image = $ct['Image'];
|
||||
if ($info[$name]['updated'] == "false") {
|
||||
$updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : array();
|
||||
$updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : [];
|
||||
$new = str_replace('sha256:', '', $updateStatus[$image]['remote']);
|
||||
$new = substr($new, 0, 4).'..'.substr($new, -4, 4);
|
||||
|
||||
|
||||
@@ -57,10 +57,10 @@ $(function() {
|
||||
</script>
|
||||
|
||||
<blockquote class="inline_help ontop">
|
||||
Click <strong><big>check for updates</big></strong> to check all plugins. This page might take some time to load depending on your internet connection and how many plugins need to be checked.
|
||||
Click <span class="strong big">check for updates</span> to check all plugins. This page might take some time to load depending on your internet connection and how many plugins need to be checked.
|
||||
</blockquote>
|
||||
|
||||
<table class='tablesorter plugins shift' id='plugin_table'>
|
||||
<thead><tr><th></th><th>Plugin</th><th>Author</th><th>Version</th><th>Status</th><th></th></tr></thead>
|
||||
<tbody id="plugin_list"><tr><td></td><td colspan='4'><br><i class="fa fa-spinner fa-spin icon"></i><em>Please wait, retrieving plugin information ...</em></td><td></td><tr></tbody>
|
||||
<tbody id="plugin_list"><tr><td colspan='6' style='text-align:center;padding-top:12px'><i class="fa fa-spinner fa-spin icon"></i><em>Please wait, retrieving plugin information ...</em></td><tr></tbody>
|
||||
</table>
|
||||
|
||||
@@ -16,7 +16,7 @@ Cond="glob('/boot/config/plugins-error/*.plg')"
|
||||
?>
|
||||
|
||||
<?
|
||||
require_once('plugins/dynamix.plugin.manager/include/PluginHelpers.php');
|
||||
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
|
||||
|
||||
echo "<table class='tablesorter' id='plugin_table'><thead>";
|
||||
echo "<tr><th>Plugin File</th><th>Status</th></tr>";
|
||||
|
||||
@@ -16,7 +16,7 @@ Cond="glob('/boot/config/plugins-stale/*.plg')"
|
||||
?>
|
||||
|
||||
<?
|
||||
require_once('plugins/dynamix.plugin.manager/include/PluginHelpers.php');
|
||||
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
|
||||
|
||||
echo "<table class='tablesorter plugins shift' id='plugin_table'><thead>";
|
||||
echo "<tr><th></th><th>Plugin</th><th>Author</th><th>Version</th><th>Status</th><th></th></tr>";
|
||||
|
||||
@@ -11,9 +11,12 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
// Invoke the plugin command with indicated method
|
||||
function plugin($method, $arg = '') {
|
||||
exec("/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin $method $arg", $output, $retval);
|
||||
global $docroot;
|
||||
exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin $method $arg", $output, $retval);
|
||||
if ($retval != 0) return false;
|
||||
return implode("\n", $output);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,13 @@
|
||||
</head>
|
||||
<body style="margin:14px 10px">
|
||||
<?
|
||||
require_once 'webGui/include/Markdown.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
require_once "$docroot/webGui/include/Markdown.php";
|
||||
|
||||
$file = $_GET['file'];
|
||||
if (file_exists($file)) echo Markdown(file_get_contents($file)); else echo Markdown("*No release notes available!*");
|
||||
?>
|
||||
<br><center><input type="button" value="Done" onclick="top.Shadowbox.close()"></center>
|
||||
<br><div style="text-align:center"><input type="button" value="Done" onclick="top.Shadowbox.close()"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'webGui/include/Markdown.php';
|
||||
require_once 'plugins/dynamix.plugin.manager/include/PluginHelpers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Markdown.php";
|
||||
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
|
||||
|
||||
$current = parse_ini_file('/etc/unraid-version');
|
||||
foreach (glob("/var/log/plugins/*.plg", GLOB_NOSORT) as $plugin_link) {
|
||||
@@ -73,7 +74,7 @@ foreach (glob("/var/log/plugins/*.plg", GLOB_NOSORT) as $plugin_link) {
|
||||
$version_info .= " <a href='#' title='View Release Notes' onclick=\"openBox('/plugins/dynamix.plugin.manager/include/ShowChanges.php?file=".urlencode($txtfile)."','Release Notes',600,900); return false\"><img src='/webGui/images/information.png' class='icon'></a>";
|
||||
}
|
||||
// action
|
||||
$action = strpos($plugin_file, "/usr/local/emhttp/plugins") !== 0 ? make_link("remove", basename($plugin_file)) : "built-in";
|
||||
$action = strpos($plugin_file, "$docroot/plugins") !== 0 ? make_link("remove", basename($plugin_file)) : "built-in";
|
||||
// write plugin information
|
||||
echo "<tr>";
|
||||
echo "<td style='vertical-align:top;width:64px'><p style='text-align:center'>{$link}</p></td>";
|
||||
|
||||
@@ -208,7 +208,7 @@ function logger($message) {
|
||||
//
|
||||
function plugin($method, $plugin_file, &$error) {
|
||||
global $unraid;
|
||||
$methods = array("install", "remove");
|
||||
$methods = ["install", "remove"];
|
||||
|
||||
// parse plugin definition XML file
|
||||
$xml = simplexml_load_file($plugin_file, NULL, LIBXML_NOCDATA);
|
||||
|
||||
@@ -12,15 +12,16 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once '/usr/local/emhttp/webGui/include/Wrappers.php';
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.plugin.manager/include/PluginHelpers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php";
|
||||
|
||||
exec("wget -qO /dev/null 127.0.0.1:$(lsof -i -P -sTCP:LISTEN|grep -Pom1 '^emhttp.*:\K\d+')/update.htm?cmdStatus=apply");
|
||||
|
||||
$current = parse_ini_file('/etc/unraid-version');
|
||||
$var = parse_ini_file('/var/local/emhttp/var.ini');
|
||||
$unraid = parse_plugin_cfg('dynamix', true);
|
||||
$notify = '/usr/local/emhttp/webGui/scripts/notify';
|
||||
$notify = "$docroot/webGui/scripts/notify";
|
||||
$server = strtoupper($var['NAME']);
|
||||
$output = $unraid['notify']['plugin'];
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@ Markdown="false"
|
||||
?>
|
||||
|
||||
<?
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/VMedit.php');
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/VMedit.php";
|
||||
?>
|
||||
@@ -16,5 +16,5 @@ Markdown="false"
|
||||
?>
|
||||
|
||||
<?
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/VMedit.php');
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/VMedit.php";
|
||||
?>
|
||||
@@ -40,8 +40,8 @@ if ($action) {
|
||||
'Error: '.$lv->get_last_error();
|
||||
}
|
||||
elseif ($subaction == 'disk-resize') {
|
||||
$capacity = str_replace(array("KB","MB","GB","TB","PB", " ", ","), array("K","M","G","T","P", "", ""), strtoupper($_POST['cap']));
|
||||
$oldcap = str_replace(array("KB","MB","GB","TB","PB", " ", ","), array("K","M","G","T","P", "", ""), strtoupper($_GET['oldcap']));
|
||||
$capacity = str_replace(["KB","MB","GB","TB","PB", " ", ","], ["K","M","G","T","P", "", ""], strtoupper($_POST['cap']));
|
||||
$oldcap = str_replace(["KB","MB","GB","TB","PB", " ", ","], ["K","M","G","T","P", "", ""], strtoupper($_GET['oldcap']));
|
||||
if (substr($oldcap,0,-1) < substr($capacity,0,-1)){
|
||||
shell_exec("qemu-img resize -q " . escapeshellarg($_GET['disk']) . " $capacity");
|
||||
$msg = $domName." disk capacity has been changed to $capacity";
|
||||
@@ -124,7 +124,7 @@ if ($action) {
|
||||
}
|
||||
} else {
|
||||
sort($doms);
|
||||
$contextMenus = array();
|
||||
$contextMenus = [];
|
||||
|
||||
for ($i = 0; $i < sizeof($doms); $i++) {
|
||||
$name = $doms[$i];
|
||||
@@ -196,8 +196,8 @@ if ($action) {
|
||||
if (!empty($vmtemplateicon)) {
|
||||
if (file_exists($vmtemplateicon)) {
|
||||
$vmicon = $vmtemplateicon;
|
||||
} else if (file_exists('/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/' . $vmtemplateicon)) {
|
||||
$vmicon = '/plugins/dynamix.vm.manager/templates/images/' . $vmtemplateicon;
|
||||
} else if (file_exists("$docroot/plugins/dynamix.vm.manager/templates/images/".$vmtemplateicon)) {
|
||||
$vmicon = "/plugins/dynamix.vm.manager/templates/images/".$vmtemplateicon;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ if ($action) {
|
||||
if($bootdev == 'cdrom')
|
||||
echo "selected ";
|
||||
echo "value='?subaction=bootdev-change&uuid=$uuid&bootdev=cdrom'>cd</option>
|
||||
</select><font size='-6'>(boot)</font>
|
||||
</select><span class='small'>(boot)</span>
|
||||
</th>
|
||||
<th class='header'>Driver type</th>
|
||||
<th class='header'>Dev Name</th>
|
||||
@@ -465,10 +465,10 @@ if ($action) {
|
||||
unset($name, $val);
|
||||
if($msg){
|
||||
if(strpos($msg, "rror:"))
|
||||
$color = 'red';
|
||||
$color = 'red-text';
|
||||
else
|
||||
$color = 'green';
|
||||
echo "<script type='text/javascript'>$(function() { $('#countdown').html('<font class=\"".$color."\">".$msg."</font>');}); </script>";
|
||||
$color = 'green-text';
|
||||
echo "<script type='text/javascript'>$(function() { $('#countdown').html('<span class=\"".$color."\">".$msg."</span>');}); </script>";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -478,7 +478,7 @@ if($msg){
|
||||
|
||||
<script>
|
||||
function vncOpen() {
|
||||
$.post('/plugins/dynamix.vm.manager/classes/vnc.php',{cmd:'open',root:'<?=$docroot?>',file:'/usr/local/emhttp/plugins/dynamix.vm.manager/vncconnect.vnc'},function(data) {
|
||||
$.post('/plugins/dynamix.vm.manager/classes/vnc.php',{cmd:'open',root:'<?=$docroot?>',file:'<?=$docroot?>/plugins/dynamix.vm.manager/vncconnect.vnc'},function(data) {
|
||||
window.location.href = data;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ Markdown="false"
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
|
||||
// Check for Intel VT-x (vmx) or AMD-V (svm) cpu virtualzation support
|
||||
@@ -265,7 +265,7 @@ foreach ($arrSyslinuxCfg as &$strSyslinuxCfg) {
|
||||
</dl>
|
||||
|
||||
<form method="POST" action="/update.php" target="progressFrame">
|
||||
<?exec("/usr/local/emhttp/webGui/scripts/btrfs_scrub status /etc/libvirt", $scrub_status, $retval);?>
|
||||
<?exec("$docroot/webGui/scripts/btrfs_scrub status /etc/libvirt", $scrub_status, $retval);?>
|
||||
|
||||
<dl>
|
||||
<dt>btrfs scrub status:</dt>
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
|
||||
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
function requireLibvirt() {
|
||||
global $lv;
|
||||
@@ -323,7 +323,7 @@ switch ($action) {
|
||||
|
||||
case 'get-vm-icons':
|
||||
$arrImages = [];
|
||||
foreach (glob("/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/*.png") as $png_file) {
|
||||
foreach (glob("$docroot/plugins/dynamix.vm.manager/templates/images/*.png") as $png_file) {
|
||||
$arrImages[] = [
|
||||
'custom' => false,
|
||||
'basename' => basename($png_file),
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
$strSelectedTemplate = array_keys($arrAllTemplates)[1];
|
||||
if (!empty($_GET['template']) && !(empty($arrAllTemplates[$_GET['template']]))) {
|
||||
@@ -42,7 +43,7 @@ if (!empty($_GET['uuid'])) {
|
||||
if (!empty($strIcon)) {
|
||||
if (is_file($strIcon)) {
|
||||
$strIconURL = $strIcon;
|
||||
} else if (is_file('/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/' . $strIcon)) {
|
||||
} else if (is_file("$docroot/plugins/dynamix.vm.manager/templates/images/" . $strIcon)) {
|
||||
$strIconURL = '/plugins/dynamix.vm.manager/templates/images/' . $strIcon;
|
||||
}
|
||||
} else {
|
||||
@@ -291,8 +292,8 @@ if (!empty($_GET['uuid'])) {
|
||||
<div id="template_img_chooser">
|
||||
<?
|
||||
$arrImagePaths = [
|
||||
'/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/*.png' => '/plugins/dynamix.vm.manager/templates/images/',
|
||||
'/usr/local/emhttp/boot/config/plugins/dynamix.vm.manager/templates/images/*.png' => '/boot/config/plugins/dynamix.vm.manager/templates/images/'
|
||||
"$docroot/plugins/dynamix.vm.manager/templates/images/*.png" => '/plugins/dynamix.vm.manager/templates/images/',
|
||||
"$docroot/boot/config/plugins/dynamix.vm.manager/templates/images/*.png" => '/boot/config/plugins/dynamix.vm.manager/templates/images/'
|
||||
];
|
||||
foreach ($arrImagePaths as $strGlob => $strIconURLBase) {
|
||||
foreach (glob($strGlob) as $png_file) {
|
||||
@@ -316,7 +317,7 @@ if (!empty($_GET['uuid'])) {
|
||||
<p>If you want this VM to start with the array, set this to yes.</p>
|
||||
</blockquote>
|
||||
|
||||
<div id="form_content"><? include('/usr/local/emhttp/plugins/dynamix.vm.manager/templates/'.$arrLoad['form']); ?></div>
|
||||
<div id="form_content"><? include "$docroot/plugins/dynamix.vm.manager/templates/{$arrLoad['form']}"; ?></div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -17,14 +17,12 @@ Cond="(pgrep('libvirtd')!==false)"
|
||||
<link type="text/css" rel="stylesheet" href="/plugins/dynamix.vm.manager/styles/dynamix.vm.manager.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.filetree.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
|
||||
<style type="text/css">
|
||||
body{-webkit-overflow-scrolling:touch;}
|
||||
.fileTree{width:305px;max-height:150px;overflow:scroll;position:absolute;z-index:100;display:none;}
|
||||
</style>
|
||||
<script src="/webGui/javascript/jquery.filetree.js"></script>
|
||||
<script src="/webGui/javascript/jquery.switchbutton.js"></script>
|
||||
<script src="/webGui/javascript/context.js"></script>
|
||||
<script src="/plugins/dynamix.vm.manager/scripts/dynamix.vm.manager.js"></script>
|
||||
|
||||
<?
|
||||
@@ -33,8 +31,8 @@ if ($var['fsState'] != "Started") {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
if (count($pages)==2) $tabbed = false;
|
||||
?>
|
||||
@@ -15,7 +15,7 @@
|
||||
private $conn;
|
||||
private $last_error;
|
||||
private $allow_cached = true;
|
||||
private $dominfos = array();
|
||||
private $dominfos = [];
|
||||
private $enabled = false;
|
||||
|
||||
function Libvirt($uri = false, $login = false, $pwd = false, $debug=false) {
|
||||
@@ -80,7 +80,7 @@
|
||||
$arrReturn = [];
|
||||
|
||||
if (!empty($disk['size'])) {
|
||||
$disk['size'] = str_replace(array("KB","MB","GB","TB","PB"), array("K","M","G","T","P"), strtoupper($disk['size']));
|
||||
$disk['size'] = str_replace(["KB","MB","GB","TB","PB"], ["K","M","G","T","P"], strtoupper($disk['size']));
|
||||
}
|
||||
if (empty($disk['driver'])) {
|
||||
$disk['driver'] = 'raw';
|
||||
@@ -845,7 +845,7 @@
|
||||
|
||||
function connect($uri = 'null', $login = false, $password = false) {
|
||||
if ($login !== false && $password !== false) {
|
||||
$this->conn=libvirt_connect($uri, false, array(VIR_CRED_AUTHNAME => $login, VIR_CRED_PASSPHRASE => $password));
|
||||
$this->conn=libvirt_connect($uri, false, [VIR_CRED_AUTHNAME => $login, VIR_CRED_PASSPHRASE => $password]);
|
||||
} else {
|
||||
$this->conn=libvirt_connect($uri, false);
|
||||
}
|
||||
@@ -960,7 +960,7 @@
|
||||
$disks = $this->get_xpath($dom, '//domain/devices/disk[@device="cdrom"]/target/@dev', false);
|
||||
$files = $this->get_xpath($dom, '//domain/devices/disk[@device="cdrom"]/source/@file', false);
|
||||
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
for ($i = 0; $i < $disks['num']; $i++) {
|
||||
$tmp = libvirt_domain_get_block_info($dom, $disks[$i]);
|
||||
if ($tmp) {
|
||||
@@ -970,7 +970,7 @@
|
||||
else {
|
||||
$this->_set_last_error();
|
||||
|
||||
$ret[] = array(
|
||||
$ret[] = [
|
||||
'device' => $disks[$i],
|
||||
'file' => $files[$i],
|
||||
'type' => '-',
|
||||
@@ -978,7 +978,7 @@
|
||||
'allocation' => '-',
|
||||
'physical' => '-',
|
||||
'bus' => $buses[$i]
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,7 +1008,7 @@
|
||||
$disks = $this->get_xpath($dom, '//domain/devices/disk[@device="disk"]/target/@dev', false);
|
||||
$files = $this->get_xpath($dom, '//domain/devices/disk[@device="disk"]/source/@*', false);
|
||||
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
for ($i = 0; $i < $disks['num']; $i++) {
|
||||
$tmp = libvirt_domain_get_block_info($dom, $disks[$i]);
|
||||
if ($tmp) {
|
||||
@@ -1031,7 +1031,7 @@
|
||||
else {
|
||||
$this->_set_last_error();
|
||||
|
||||
$ret[] = array(
|
||||
$ret[] = [
|
||||
'device' => $disks[$i],
|
||||
'file' => $files[$i],
|
||||
'type' => '-',
|
||||
@@ -1039,7 +1039,7 @@
|
||||
'allocation' => '-',
|
||||
'physical' => '-',
|
||||
'bus' => $buses[$i]
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1300,7 +1300,7 @@
|
||||
function get_node_device_cap_options() {
|
||||
$all = $this->get_node_devices();
|
||||
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
for ($i = 0; $i < sizeof($all); $i++) {
|
||||
$tmp = $this->get_node_device_caps($all[$i]);
|
||||
|
||||
@@ -1331,7 +1331,7 @@
|
||||
}
|
||||
|
||||
function domain_get_info_call($name = false, $name_override = false) {
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
|
||||
if ($name != false) {
|
||||
$dom = $this->get_domain_object($name);
|
||||
@@ -1522,7 +1522,7 @@
|
||||
$seed = time();
|
||||
srand($seed);
|
||||
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
for ($i = 0; $i < 16; $i++)
|
||||
$ret[] = $this->macbyte(rand() % 256);
|
||||
|
||||
@@ -1764,7 +1764,7 @@
|
||||
if (!$tmp)
|
||||
return false;
|
||||
|
||||
$devs = array();
|
||||
$devs = [];
|
||||
for ($i = 0; $i < $tmp['num']; $i++)
|
||||
$devs[] = $tmp[$i];
|
||||
|
||||
@@ -1800,7 +1800,7 @@
|
||||
if (!$tmp)
|
||||
return false;
|
||||
|
||||
$devs = array();
|
||||
$devs = [];
|
||||
for ($i = 0; $i < $tmp['num']; $i++)
|
||||
$devs[] = $tmp[$i];
|
||||
|
||||
@@ -1813,13 +1813,13 @@
|
||||
$sources = $this->get_xpath($domain, $xpath.'/source/@dir', false);
|
||||
$targets = $this->get_xpath($domain, $xpath.'/target/@dir', false);
|
||||
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
if (!empty($sources)) {
|
||||
for ($i = 0; $i < $sources['num']; $i++) {
|
||||
$ret[] = array(
|
||||
$ret[] = [
|
||||
'source' => $sources[$i],
|
||||
'target' => $targets[$i]
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1852,7 +1852,7 @@
|
||||
if ($display)
|
||||
return $type.' ('.$targetType.' on port '.$targetPort.')';
|
||||
else
|
||||
return array('type' => $type, 'targetType' => $targetType, 'targetPort' => $targetPort);
|
||||
return ['type' => $type, 'targetType' => $targetType, 'targetPort' => $targetPort];
|
||||
}
|
||||
else
|
||||
if ($type == 'input') {
|
||||
@@ -1862,7 +1862,7 @@
|
||||
if ($display)
|
||||
return $type.' on '.$bus;
|
||||
else
|
||||
return array('type' => $type, 'bus' => $bus);
|
||||
return ['type' => $type, 'bus' => $bus];
|
||||
}
|
||||
else
|
||||
if ($type == 'graphics') {
|
||||
@@ -1873,7 +1873,7 @@
|
||||
if ($display)
|
||||
return $type.' on port '.$port.' with'.($autoport ? '' : 'out').' autoport enabled';
|
||||
else
|
||||
return array('type' => $type, 'port' => $port, 'autoport' => $autoport);
|
||||
return ['type' => $type, 'port' => $port, 'autoport' => $autoport];
|
||||
}
|
||||
else
|
||||
if ($type == 'video') {
|
||||
@@ -1884,7 +1884,7 @@
|
||||
if ($display)
|
||||
return $type.' with '.($vram / 1024).' MB VRAM, '.$heads.' head(s)';
|
||||
else
|
||||
return array('type' => $type, 'vram' => $vram, 'heads' => $heads);
|
||||
return ['type' => $type, 'vram' => $vram, 'heads' => $heads];
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@@ -1898,11 +1898,11 @@
|
||||
$slot = $this->get_xpath($domain, $xpath.'slot', false);
|
||||
$func = $this->get_xpath($domain, $xpath.'function', false);
|
||||
|
||||
$devs = array();
|
||||
$devs = [];
|
||||
for ($i = 0; $i < $bus['num']; $i++) {
|
||||
$devid = str_replace('0x', '', 'pci_'.$dom[$i].'_'.$bus[$i].'_'.$slot[$i].'_'.$func[$i]);
|
||||
$tmp2 = $this->get_node_device_information($devid);
|
||||
$devs[] = array(
|
||||
$devs[] = [
|
||||
'domain' => $dom[$i],
|
||||
'bus' => $bus[$i],
|
||||
'slot' => $slot[$i],
|
||||
@@ -1912,7 +1912,7 @@
|
||||
'vendor_id' => $tmp2['vendor_id'],
|
||||
'product' => $tmp2['product_name'],
|
||||
'product_id' => $tmp2['product_id']
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
// Get any pci devices contained in the qemu args
|
||||
@@ -1929,10 +1929,10 @@
|
||||
$keypair = explode('=', $arg);
|
||||
|
||||
if ($keypair[0] == 'host' && !empty($keypair[1])) {
|
||||
$devid = 'pci_0000_' . str_replace(array(':', '.'), '_', $keypair[1]);
|
||||
$devid = 'pci_0000_' . str_replace([':', '.'], '_', $keypair[1]);
|
||||
$tmp2 = $this->get_node_device_information($devid);
|
||||
list($bus, $slot, $func) = explode(":", str_replace('.', ':', $keypair[1]));
|
||||
$devs[] = array(
|
||||
$devs[] = [
|
||||
'domain' => '0x0000',
|
||||
'bus' => '0x' . $bus,
|
||||
'slot' => '0x' . $slot,
|
||||
@@ -1942,7 +1942,7 @@
|
||||
'vendor_id' => $tmp2['vendor_id'],
|
||||
'product' => $tmp2['product_name'],
|
||||
'product_id' => $tmp2['product_id']
|
||||
);
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1971,16 +1971,16 @@
|
||||
$vid = $this->get_xpath($domain, $xpath.'vendor/@id', false);
|
||||
$pid = $this->get_xpath($domain, $xpath.'product/@id', false);
|
||||
|
||||
$devs = array();
|
||||
$devs = [];
|
||||
for ($i = 0; $i < $vid['num']; $i++) {
|
||||
$dev = $this->_lookup_device_usb($vid[$i], $pid[$i]);
|
||||
$devs[] = array(
|
||||
$devs[] = [
|
||||
'id' => str_replace('0x', '', $vid[$i] . ':' . $pid[$i]),
|
||||
'vendor_id' => $vid[$i],
|
||||
'product_id' => $pid[$i],
|
||||
'product' => $dev['product_name'],
|
||||
'vendor' => $dev['vendor_name']
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
return $devs;
|
||||
@@ -1992,7 +1992,7 @@
|
||||
$devs_pci = $this->domain_get_host_devices_pci($domain);
|
||||
$devs_usb = $this->domain_get_host_devices_usb($domain);
|
||||
|
||||
return array('pci' => $devs_pci, 'usb' => $devs_usb);
|
||||
return ['pci' => $devs_pci, 'usb' => $devs_usb];
|
||||
}
|
||||
|
||||
function get_nic_info($domain) {
|
||||
@@ -2001,7 +2001,7 @@
|
||||
$bridge = $this->get_xpath($domain, "//domain/devices/interface/source/@bridge", false);
|
||||
if (!$macs)
|
||||
return $this->_set_last_error();
|
||||
$ret = array();
|
||||
$ret = [];
|
||||
for ($i = 0; $i < $macs['num']; $i++) {
|
||||
if ($net[$i] != 'bridge')
|
||||
$tmp = libvirt_domain_get_network_info($domain, $macs[$i]);
|
||||
@@ -2009,11 +2009,11 @@
|
||||
$ret[] = $tmp;
|
||||
else {
|
||||
$this->_set_last_error();
|
||||
$ret[] = array(
|
||||
$ret[] = [
|
||||
'mac' => $macs[$i],
|
||||
'network' => $bridge[$i],
|
||||
'nic_type' => 'virtio'
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,16 +11,17 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
// Load emhttp variables if needed.
|
||||
if (! isset($var)){
|
||||
if (! is_file("/usr/local/emhttp/state/var.ini")) shell_exec("wget -qO /dev/null localhost:$(lsof -nPc emhttp | grep -Po 'TCP[^\d]*\K\d+')");
|
||||
$var = @parse_ini_file("/usr/local/emhttp/state/var.ini");
|
||||
$disks = @parse_ini_file("/usr/local/emhttp/state/disks.ini", true);
|
||||
if (!is_file("$docroot/state/var.ini")) shell_exec("wget -qO /dev/null localhost:$(lsof -nPc emhttp | grep -Po 'TCP[^\d]*\K\d+')");
|
||||
$var = @parse_ini_file("$docroot/state/var.ini");
|
||||
$disks = @parse_ini_file("$docroot/state/disks.ini", true);
|
||||
extract(parse_plugin_cfg("dynamix",true));
|
||||
}
|
||||
if (!isset($eth0) && is_file("/usr/local/emhttp/state/network.ini")) {
|
||||
extract(parse_ini_file('/usr/local/emhttp/state/network.ini',true));
|
||||
if (!isset($eth0) && is_file("$docroot/state/network.ini")) {
|
||||
extract(parse_ini_file("$docroot/state/network.ini",true));
|
||||
}
|
||||
|
||||
// Check if program is running and
|
||||
@@ -494,7 +495,7 @@
|
||||
}
|
||||
|
||||
function appendOrdinalSuffix($number) {
|
||||
$ends = array('th','st','nd','rd','th','th','th','th','th','th');
|
||||
$ends = ['th','st','nd','rd','th','th','th','th','th','th'];
|
||||
|
||||
if (($number % 100) >= 11 && ($number % 100) <= 13) {
|
||||
$abbreviation = $number . 'th';
|
||||
@@ -606,7 +607,7 @@
|
||||
$arrMatch['vendorname'] = sanitizeVendor($arrMatch['vendorname']);
|
||||
$arrMatch['productname'] = sanitizeProduct($arrMatch['productname']);
|
||||
|
||||
$arrValidPCIDevices[] = array(
|
||||
$arrValidPCIDevices[] = [
|
||||
'id' => $arrMatch['id'],
|
||||
'type' => $arrMatch['type'],
|
||||
'typeid' => $arrMatch['typeid'],
|
||||
@@ -618,7 +619,7 @@
|
||||
'driver' => $strDriver,
|
||||
'name' => $arrMatch['vendorname'] . ' ' . $arrMatch['productname'],
|
||||
'blacklisted' => $boolBlacklisted
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +681,7 @@
|
||||
return $cacheValidUSBDevices;
|
||||
}
|
||||
|
||||
$arrValidUSBDevices = array();
|
||||
$arrValidUSBDevices = [];
|
||||
|
||||
// Get a list of all usb hubs so we can blacklist them
|
||||
exec("cat /sys/bus/usb/drivers/hub/*/modalias | grep -Po 'usb:v\K\w{9}' | tr 'p' ':'", $arrAllUSBHubs);
|
||||
@@ -715,10 +716,10 @@
|
||||
// Clean up the name
|
||||
$arrMatch['name'] = sanitizeVendor($arrMatch['name']);
|
||||
|
||||
$arrValidUSBDevices[] = array(
|
||||
$arrValidUSBDevices[] = [
|
||||
'id' => $arrMatch['id'],
|
||||
'name' => $arrMatch['name'],
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -868,7 +869,7 @@
|
||||
|
||||
function getHostCPUModel() {
|
||||
$cpu = explode('#', exec("dmidecode -q -t 4|awk -F: '{if(/Version:/) v=$2; else if(/Current Speed:/) s=$2} END{print v\"#\"s}'"));
|
||||
list($strCPUModel) = explode('@', str_replace(array("Processor","CPU","(C)","(R)","(TM)"), array("","","©","®","™"), $cpu[0]) . '@');
|
||||
list($strCPUModel) = explode('@', str_replace(["Processor","CPU","(C)","(R)","(TM)"], ["","","©","®","™"], $cpu[0]) . '@');
|
||||
return trim($strCPUModel);
|
||||
}
|
||||
|
||||
@@ -967,10 +968,10 @@
|
||||
// Add claimed USB devices by this VM to the available USB devices
|
||||
/*
|
||||
foreach($arrUSBDevs as $arrUSB) {
|
||||
$arrValidUSBDevices[] = array(
|
||||
$arrValidUSBDevices[] = [
|
||||
'id' => $arrUSB['id'],
|
||||
'name' => $arrUSB['product'],
|
||||
);
|
||||
];
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
$arrValidMachineTypes = getValidMachineTypes();
|
||||
$arrValidGPUDevices = getValidGPUDevices();
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
$arrValidMachineTypes = getValidMachineTypes();
|
||||
$arrValidGPUDevices = getValidGPUDevices();
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
$arrValidMachineTypes = getValidMachineTypes();
|
||||
$arrValidGPUDevices = getValidGPUDevices();
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once('/usr/local/emhttp/webGui/include/Helpers.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php');
|
||||
require_once('/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php');
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
$strXML = '';
|
||||
$strUUID = '';
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
|
||||
|
||||
<!-- Stylesheets -->
|
||||
<link rel="stylesheet" href="include/base.css" />
|
||||
<link rel="alternate stylesheet" href="include/black.css" TITLE="Black" />
|
||||
<link rel="alternate stylesheet" href="include/blue.css" TITLE="Blue" />
|
||||
<link rel="stylesheet" href="styles/base.css" />
|
||||
<link rel="alternate stylesheet" href="styles/black.css" TITLE="Black" />
|
||||
<link rel="alternate stylesheet" href="styles/blue.css" TITLE="Blue" />
|
||||
|
||||
<!--
|
||||
<script type='text/javascript'
|
||||
|
||||
@@ -16,9 +16,28 @@ Title="Array Devices"
|
||||
<script>
|
||||
var timer = null;
|
||||
|
||||
function display_diskio() {
|
||||
if ($.cookie('diskio')===undefined) {
|
||||
$('span.number').show(); $('span.diskio').hide();
|
||||
} else {
|
||||
$('span.diskio').show(); $('span.number').hide();
|
||||
}
|
||||
}
|
||||
function toggle_diskio(init) {
|
||||
if (!init) {
|
||||
if ($.cookie('diskio')===undefined) $.cookie('diskio','diskio',{path:'/',expires:3650}); else $.removeCookie('diskio',{path:'/'});
|
||||
}
|
||||
if ($.cookie('diskio')===undefined) {
|
||||
$('i.toggle').removeClass('fa-tachometer').addClass('fa-list');
|
||||
} else {
|
||||
$('i.toggle').removeClass('fa-list').addClass('fa-tachometer');
|
||||
}
|
||||
display_diskio();
|
||||
}
|
||||
function array_status() {
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'array'},function(data) {
|
||||
if (data) $('#array_devices').html(data);
|
||||
var diskio = $.cookie('diskio')===undefined ? 0 : 1;
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'array',diskio:diskio},function(data) {
|
||||
if (data) {$('#array_devices').html(data); display_diskio();}
|
||||
<?if ($update && $var['fsState']=='Started'):?>
|
||||
<?if ($tabbed):?>
|
||||
if ($('#tab1').is(':checked')) timer = setTimeout(array_status,<?=abs($display['refresh'])?>);
|
||||
@@ -29,7 +48,9 @@ function array_status() {
|
||||
});
|
||||
}
|
||||
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
|
||||
$('#tab1').bind({click:function() {clearTimeout(timer); array_status();}});
|
||||
$('#tab1').bind({click:function() {clearTimeout(timer); array_status(); $('i.toggle').show('slow');}});
|
||||
<?else:?>
|
||||
$('#tab1').bind({click:function() {$('i.toggle').show('slow');}});
|
||||
<?endif;?>
|
||||
|
||||
array_status();
|
||||
|
||||
@@ -34,7 +34,10 @@ function status_indicator() {
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
var forced = <?=$confirm['down'] ? 'false' : 'true'?>;
|
||||
var ask1 = <?=$confirm['stop'] ? 'true' : 'false'?>;
|
||||
var ask2 = <?=$confirm['down'] ? 'true' : 'false'?>;
|
||||
var ctrl = "<span class='status'><a style='cursor:pointer' title='Toggle reads/writes display' onclick='toggle_diskio();return false'><i class='toggle fa'></i></a></span>";
|
||||
var rbtn = "<span class='status vhshift hshift'><input type='button' value='Refresh' onclick='refresh()'></span>";
|
||||
|
||||
function tab0() {
|
||||
$.removeCookie('one',{path:'/'});
|
||||
@@ -50,7 +53,7 @@ function parity_status() {
|
||||
setTimeout(parity_status,<?=abs($display['refresh'])?>);
|
||||
<?endif;?>
|
||||
if (!data && $('#cancelButton').length>0 && $('#cancelButton').val()=='Cancel') {
|
||||
$('#cancelButton').prop('type','button').val('Done').bind({click:function(){refresh();}});
|
||||
$('#cancelButton').val('Done').unbind().bind({click:function(){refresh();}});
|
||||
$('#cancelText').html('');
|
||||
$('#line4').html('completed');
|
||||
}
|
||||
@@ -72,26 +75,40 @@ function parity_warning(form) {
|
||||
}
|
||||
function stop_array(form) {
|
||||
$(form).append('<input type="hidden" name="cmdStop" value="Stop">');
|
||||
if (forced) {
|
||||
form.submit();
|
||||
} else {
|
||||
if (ask1) {
|
||||
swal({title:'Proceed?',text:'This will stop the array',type:'warning',showCancelButton:true},function(p){if (p) form.submit(); else $('input[name="cmdStop"]').remove();});
|
||||
} else {
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
function stop_parity(form,text) {
|
||||
$(form).append('<input type="hidden" name="cmdNoCheck" value="Cancel">');
|
||||
if (ask1) {
|
||||
swal({title:'Proceed?',text:'This will stop the running '+text+' operation',type:'warning',showCancelButton:true},function(p){if (p) form.submit(); else $('input[name="cmdNoCheck"]').remove();});
|
||||
} else {
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
function system(cmd) {
|
||||
var boot = '/webGui/include/Boot.php';
|
||||
var page = '/'+cmd+'.htm';
|
||||
if (forced) {
|
||||
$.post(boot,{cmd:cmd},function(){location=page;});
|
||||
} else {
|
||||
if (ask2) {
|
||||
swal({title:'Proceed?',text:'This will '+cmd+' the system',type:'warning',showCancelButton:true},function(){$.post(boot,{cmd:cmd},function(){location=page;});});
|
||||
} else {
|
||||
$.post(boot,{cmd:cmd},function(){location=page;});
|
||||
}
|
||||
}
|
||||
parity_status();
|
||||
|
||||
<?if ($tabbed):?>
|
||||
$('.tabs').append(ctrl);
|
||||
<?else:?>
|
||||
$('div[id=title]:not(":last")').each(function(){$(this).append(ctrl);});
|
||||
<?endif;?>
|
||||
<?if ($update):?>
|
||||
<?if ($tabbed):?>
|
||||
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {clearTimeout(timer); parity_status(); tab0();}});
|
||||
if ($.cookie('tab')=='tab0') $('i.toggle').hide();
|
||||
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {clearTimeout(timer); parity_status(); tab0(); $('i.toggle').hide('slow');}});
|
||||
<?endif;?>
|
||||
<?if (substr($var['fsState'],-3)=='ing'):?>
|
||||
function reload_page() {
|
||||
@@ -113,11 +130,16 @@ function reload_page() {
|
||||
reload_page();
|
||||
<?endif;?>
|
||||
<?else:?>
|
||||
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {tab0();}});
|
||||
$('#tab'+$('input[name$="tabs"]').length).bind({click:function() {tab0(); $('i.toggle').hide('slow');}});
|
||||
<?endif;?>
|
||||
<?if ($display['refresh']==0 || ($display['refresh']<0 && $var['mdResync']>0)):?>
|
||||
$('.tabs').append("<span class='status vhshift'><input type='button' value='Refresh' onclick='refresh()'></span>");
|
||||
<?if ($tabbed):?>
|
||||
$('.tabs').append(rbtn);
|
||||
<?else:?>
|
||||
$('div[id=title]:first').append(rbtn);
|
||||
<?endif;?>
|
||||
<?endif;?>
|
||||
toggle_diskio(true);
|
||||
</script>
|
||||
<form name="arrayOps" method="POST" action="/update.htm" target="progressFrame">
|
||||
<input type="hidden" name="startState" value="<?=$var['mdState']?>">
|
||||
@@ -127,14 +149,14 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
switch ($var['fsState']):
|
||||
case "Started":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Started<?=(($var['startMode']=='Maintenance')?' - Maintenance Mode':'')?></strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Started<?=(($var['startMode']=='Maintenance')?' - Maintenance Mode':'')?></span></td>
|
||||
<td><input type="button" value="Stop" onclick="stop_array(this.form)"<?if ($parity||$mover):?> disabled<?endif;?>></td>
|
||||
<td><strong>Stop</strong> will take the array off-line.<?=$parity?"<br>$parity":($mover?"<br>$mover":"")?></td>
|
||||
</tr>
|
||||
<? if ($var['fsNumUnmountable']>0):?>
|
||||
<tr>
|
||||
<td><strong>Unmountable disk<?=$var['fsNumUnmountable']==1?'':'s'?> present:</strong><br>
|
||||
<? foreach ($disks as $disk) if ($disk['fsStatus']=='Unmountable') echo "<br><font color='#3B5998'>".my_disk($disk['name'])."</font> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<? foreach ($disks as $disk) if ($disk['fsStatus']=='Unmountable') echo "<br><span class='blue-text'>".my_disk($disk['name'])."</span> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><input type="submit" id="cmdFormat" name="cmdFormat" value="Format" disabled><input type="hidden" name="unmountable_mask" value="<?=$var['fsUnmountableMask']?>"></td>
|
||||
<td><strong>Format</strong> will create a file system in all <strong>Unmountable</strong> disks, discarding all data currently on those disks.<br>
|
||||
<input type="checkbox" name="confirmFormat" value="OFF" onClick="arrayOps.cmdFormat.disabled=!arrayOps.confirmFormat.checked"><small>Yes I want to do this</small>
|
||||
@@ -211,26 +233,26 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
if ($var['mdResyncAction']=="check"):?>
|
||||
<tr>
|
||||
<td>Read-Check in progress.</td>
|
||||
<td><input type="submit" name="cmdNoCheck" id="cancelButton" value="Cancel"></td>
|
||||
<td><input type="button" id="cancelButton" value="Cancel" onclick="stop_parity(this.form,'Read-Check')"></td>
|
||||
<td id="cancelText"><strong>Cancel</strong> will stop the Read-Check.</td>
|
||||
</tr>
|
||||
<? elseif (strstr($var['mdResyncAction'],"check")):?>
|
||||
<tr>
|
||||
<td>Parity-Check in progress.</td>
|
||||
<td><input type="submit" name="cmdNoCheck" id="cancelButton" value="Cancel"></td>
|
||||
<td><input type="button" id="cancelButton" value="Cancel" onclick="stop_parity(this.form,'Parity-Check')"></td>
|
||||
<td id="cancelText"><strong>Cancel</strong> will stop the Parity-Check.</td>
|
||||
</tr>
|
||||
<? elseif (strstr($var['mdResyncAction'],"recon")):?>
|
||||
<tr>
|
||||
<td>Parity-Sync/Data-Rebuild in progress.</td>
|
||||
<td><input type="submit" name="cmdNoCheck" id="cancelButton" value="Cancel"></td>
|
||||
<td><input type="button" id="cancelButton" value="Cancel" onclick="stop_parity(this.form,'Parity-Sync/Data-Rebuild')"></td>
|
||||
<td id="cancelText"><strong>Cancel</strong> will stop Parity-Sync/Data-Rebuild.
|
||||
<br>WARNING: canceling may leave the array unprotected!</td>
|
||||
</tr>
|
||||
<? elseif (strstr($var['mdResyncAction'],"clear")):?>
|
||||
<tr>
|
||||
<td>Clearing in progress.</td>
|
||||
<td><input type="submit" name="cmdNoCheck" id="cancelButton" value="Cancel"></td>
|
||||
<td><input type="button" id="cancelButton" value="Cancel" onclick="stop_parity(this.form,'Clearing')"></td>
|
||||
<td id="cancelText"><strong>Cancel</strong> will stop Clearing.</td>
|
||||
</tr>
|
||||
<? endif;?>
|
||||
@@ -270,35 +292,35 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
break;
|
||||
case "Mounting":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Starting...</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Starting...</span></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "Formatting":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Started, formatting...</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Started, formatting...</span></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "Copying":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><span id="fsState"><strong>Copying, <?=$var['fsCopyPrcnt']?>% complete...</strong></span></td>
|
||||
<td><?=status_indicator()?><span id="fsState" class="strong big">Copying, <?=$var['fsCopyPrcnt']?>% complete...</span></td>
|
||||
<td><input type="submit" name="cmdNoCopy" value="Cancel"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "Clearing":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><span id="fsState"><strong>Clearing, <?=$var['fsClearPrcnt']?>% complete...</strong></span></td>
|
||||
<td><?=status_indicator()?><span id="fsState" class="strong big">Clearing, <?=$var['fsClearPrcnt']?>% complete...</span></td>
|
||||
<td><input type="submit" name="cmdNoClear" value="Cancel"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "Stopping":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopping...</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopping...</span></td>
|
||||
<td><input type="submit" name="cmdStop" value="Stop" disabled></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@@ -306,25 +328,25 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
case "Stopped":
|
||||
if ($var['configValid']=="error"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped.</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped.</span></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>Invalid, missing or expired <a href="/Tools/Registration">registration key</a>.</td>
|
||||
</tr>
|
||||
<? elseif ($var['configValid']=="invalid"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped.</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped.</span></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>Too many attached devices. Please consider upgrading your <a href="/Tools/Registration">registration key</a>.</td>
|
||||
</tr>
|
||||
<? elseif ($var['configValid']=="nokeyserver"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped.</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped.</span></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>Cannot contact key-server. Please check your <a href="/Settings/NetworkSettings">network settings</a>.</td>
|
||||
</tr>
|
||||
<? elseif ($var['configValid']=="withdrawn"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped.</strong></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped.</span></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>This unRAID Server OS release has been withdrawn and may no longer be used. Please <a href="/Plugins">update</a> your server.</td>
|
||||
</tr>
|
||||
@@ -333,26 +355,26 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
case "STOPPED":
|
||||
if (strstr($var['mdResyncAction'],"recon")):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Configuration valid.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Configuration valid.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start"></td>
|
||||
<td><strong>Start</strong> will bring the array on-line and start <strong>Parity-Sync</strong> and/or <strong>Data-Rebuild</strong>.</td>
|
||||
</tr>
|
||||
<? elseif ($var['mdResyncAction']=="clear"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. New data disks(s) detected.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. New data disks(s) detected.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start"></td>
|
||||
<td><strong>Start</strong> will bring the array on-line and start <strong>Clearing</strong> new data disk(s).</td>
|
||||
</tr>
|
||||
<? elseif ($var['sbClean']!="yes" && $var['mdResyncAction']=="check"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Unclean shutdown detected.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Unclean shutdown detected.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start"></td>
|
||||
<td><strong>Start</strong> will bring the array on-line and start <strong>Parity-Check</strong>.
|
||||
<br><input type="checkbox" name="optionCorrect" value="correct" checked><small>Write corrections to parity</small></td>
|
||||
</tr>
|
||||
<? else:?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Configuration valid.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Configuration valid.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start"></td>
|
||||
<td><strong>Start</strong> will bring the array on-line.</td>
|
||||
</tr>
|
||||
@@ -362,14 +384,14 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
case "NEW_ARRAY":
|
||||
if (strpos($disks['parity']['status'],"DISK_NP")===0 && (empty($disks['parity2']) || strpos($disks['parity2']['status'],"DISK_NP")===0)):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Configuration valid.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Configuration valid.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start"></td>
|
||||
<td><strong>Start</strong> will record all disk information and bring the array on-line.
|
||||
<br>The array will be immediately available, but <strong>unprotected</strong> since <em>parity</em> has not been assigned.</td>
|
||||
</tr>
|
||||
<? else:?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Configuration valid.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Configuration valid.</td>
|
||||
<td><input type="button" value="Start" onclick="parity_warning(this.form)"></td>
|
||||
<td><strong>Start</strong> will record all disk information, bring the array on-line, and start Parity-Sync.
|
||||
<br>The array will be immediately available, but <strong>unprotected</strong> until Parity-Sync completes.
|
||||
@@ -380,8 +402,8 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
break;
|
||||
case "UNPROTECTED_EXPANSION":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Found <?=my_word($var['mdNumNew'])?> new disk<?=$var['mdNumNew']==1?'':'s'?>.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_NEW') echo "<br><font color='#3B5998'>".my_disk($disk['name'])."</font> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Found <?=my_word($var['mdNumNew'])?> new disk<?=$var['mdNumNew']==1?'':'s'?>.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_NEW') echo "<br><span class='blue-text'>".my_disk($disk['name'])."</span> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start"></td>
|
||||
<td><strong>Start</strong> will record the new disk<?=$var['mdNumNew']==1?'':'s'?> information and bring the expanded array on-line.</td>
|
||||
</tr>
|
||||
@@ -390,8 +412,8 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
case "PROTECTED_EXPANSION":
|
||||
if ($var['mdNumErased']==$var['mdNumNew']):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Found <?=my_word($var['mdNumNew'])?> new erased disk<?=$var['mdNumNew']==1?'':'s'?>.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_NEW') echo "<br><font color='#3B5998'>".my_disk($disk['name'])."</font> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Found <?=my_word($var['mdNumNew'])?> new erased disk<?=$var['mdNumNew']==1?'':'s'?>.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_NEW') echo "<br><span class='blue-text'>".my_disk($disk['name'])."</span> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td><strong>Start</strong> will record the new disk<?=$var['mdNumNew']==1?'':'s'?> information and bring the expanded array on-line.
|
||||
<br><input type="checkbox" name="confirmStart" value="OFF" onClick="arrayOps.cmdStart.disabled=!arrayOps.confirmStart.checked"><small>Yes I want to do this</small></td>
|
||||
@@ -399,8 +421,8 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
<? maintenance_mode();
|
||||
else:?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Found <?=my_word($var['mdNumNew'])?> new disk<?=$var['mdNumNew']==1?'':'s'?>.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_NEW') echo "<br><font color='#3B5998'>".my_disk($disk['name'])."</font> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Found <?=my_word($var['mdNumNew'])?> new disk<?=$var['mdNumNew']==1?'':'s'?>.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_NEW') echo "<br><span class='blue-text'>".my_disk($disk['name'])."</span> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><input type="submit" name="cmdClear" value="Clear" disabled></td>
|
||||
<td><strong>Clear</strong> will completely clear (set to zero) the new disk<?=$var['mdNumNew']==1?'':'s'?>.
|
||||
<br>Once clear completes, the array may be Started, expanding the array to include the new disk<?=$var['mdNumNew']==1?'':'s'?>.
|
||||
@@ -412,7 +434,7 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
break;
|
||||
case "DISABLE_DISK":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Missing disk.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Missing disk.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td><strong>Start</strong> will disable the missing disk and then bring the array on-line.
|
||||
<br>Install a replacement disk as soon as possible.
|
||||
@@ -422,7 +444,7 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
break;
|
||||
case "RECON_DISK":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Replacement disk installed.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Replacement disk installed.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td><strong>Start</strong> will start <strong>Parity-Sync</strong> and/or <strong>Data-Rebuild</strong>.
|
||||
<br><input type="checkbox" name="confirmStart" value="OFF" onClick="arrayOps.cmdStart.disabled=!arrayOps.confirmStart.checked"><small>Yes I want to do this</small></td>
|
||||
@@ -432,7 +454,7 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
case "SWAP_DSBL":
|
||||
if ($var['fsCopyPrcnt']=="100"):?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Ugrading disk/swapping parity.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Ugrading disk/swapping parity.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td><strong>Start</strong> will expand the file system of the data disk (if possible); then bring the array on-line and start Data-Rebuild.
|
||||
<br><input type="checkbox" name="confirmStart" value="OFF" onClick="arrayOps.cmdStart.disabled=!arrayOps.confirmStart.checked"><small>Yes I want to do this</small></td>
|
||||
@@ -440,7 +462,7 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
<? maintenance_mode();
|
||||
else:?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Ugrading disk/swapping parity.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Ugrading disk/swapping parity.</td>
|
||||
<td><input type="submit" name="cmdCopy" value="Copy" disabled></td>
|
||||
<td><strong>Copy</strong> will copy the parity information to the new <em>parity</em> disk.
|
||||
<br>Once copy completes, the array may be Started, to initiate Data-Rebuild of the disabled disk.
|
||||
@@ -450,8 +472,8 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
break;
|
||||
case "RECORD_DISKS":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Two or more disks are wrong.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_WRONG') echo "<br><font color='#3B5998'>".my_disk($disk['name'])."</font> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Two or more disks are wrong.<br>
|
||||
<? foreach ($disks as $disk) if ($disk['status']=='DISK_WRONG') echo "<br><span class='blue-text'>".my_disk($disk['name'])."</span> • ".my_id($disk['id'])." (".$disk['device'].")";?></td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td><strong>Start</strong> will just record the new disk positions and bring the array on-line.
|
||||
<br>We recommend you start a Parity-Check afterwards just to be safe.
|
||||
@@ -461,21 +483,21 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
break;
|
||||
case "ERROR:INVALID_EXPANSION":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Invalid expansion.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Invalid expansion.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>You may not add new disk(s) and also remove existing disk(s).</td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "ERROR:NEW_DISK_TOO_SMALL":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Replacement disk is too small.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Replacement disk is too small.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>The replacement disk must be as big or bigger than the original.</td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "ERROR:PARITY_NOT_BIGGEST":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Disk in parity slot is not biggest.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Disk in parity slot is not biggest.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>If this is a new array, move the largest disk into the <em>parity</em> slot.
|
||||
<br>If you are adding a new disk or replacing a disabled disk, try Parity-Swap.</td>
|
||||
@@ -483,14 +505,14 @@ $('.tabs').append("<span class='status vhshift'><input type='button' value='Refr
|
||||
<? break;
|
||||
case "ERROR:TOO_MANY_MISSING_DISKS":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. Invalid configuration.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. Invalid configuration.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>Too many wrong and/or missing disks!</td>
|
||||
</tr>
|
||||
<? break;
|
||||
case "ERROR:NO_DATA_DISKS":?>
|
||||
<tr>
|
||||
<td><?=status_indicator()?><strong>Stopped</strong>. No data disks.</td>
|
||||
<td><?=status_indicator()?><span class="strong big">Stopped</span>. No data disks.</td>
|
||||
<td><input type="submit" name="cmdStart" value="Start" disabled></td>
|
||||
<td>No array data disks have been assigned!</td>
|
||||
</tr>
|
||||
|
||||
@@ -15,8 +15,9 @@ Title="Boot Device"
|
||||
?>
|
||||
<script>
|
||||
function boot_status() {
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'flash'},function(data) {
|
||||
if (data) $('#boot_device').html(data);
|
||||
var diskio = $.cookie('diskio')===undefined ? 0 : 1;
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'flash'<?if ($tabbed):?>,diskio:diskio<?endif?>},function(data) {
|
||||
if (data) {$('#boot_device').html(data); display_diskio();}
|
||||
<?if ($update && $var['fsState']=='Started'):?>
|
||||
<?if ($tabbed):?>
|
||||
if ($('#tab3').is(':checked')) timer = setTimeout(boot_status,<?=abs($display['refresh'])?>);
|
||||
@@ -27,7 +28,9 @@ function boot_status() {
|
||||
});
|
||||
}
|
||||
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
|
||||
$('#tab3').bind({click:function() {clearTimeout(timer); boot_status();}});
|
||||
$('#tab3').bind({click:function() {clearTimeout(timer); boot_status(); $('i.toggle').show('slow');}});
|
||||
<?else:?>
|
||||
$('#tab3').bind({click:function() {$('i.toggle').show('slow');}});
|
||||
<?endif;?>
|
||||
|
||||
boot_status();
|
||||
|
||||
@@ -23,33 +23,30 @@ function sort_by($field, $opt, $show_disk) {
|
||||
// read directory contents into 'list' array
|
||||
global $docroot,$dir;
|
||||
$path = $docroot.preg_replace('/([\'" &()[\]\\\\])/','\\\\$1',$dir).'/*';
|
||||
$file = array(); $list = array();
|
||||
$file = []; $list = [];
|
||||
$i = 0;
|
||||
exec("shopt -s dotglob ; stat -L -c'%F|%n|%s|%Y' $path 2>/dev/null", $file);
|
||||
foreach ($file as $entry) {
|
||||
$attr = explode('|', $entry);
|
||||
$info = pathinfo($attr[1]);
|
||||
$list[] = array(
|
||||
$list[] = [
|
||||
'type' => $attr[0],
|
||||
'name' => $info['basename'],
|
||||
'fext' => strtolower($info['extension']),
|
||||
'size' => $attr[2],
|
||||
'time' => $attr[3],
|
||||
'disk' => $show_disk?my_disk(exec("shopt -s dotglob ; getfattr --no-dereference --absolute-names --only-values -n system.LOCATIONS ".escapeshellarg($attr[1]))):'');
|
||||
'disk' => $show_disk?my_disk(exec("shopt -s dotglob ; getfattr --no-dereference --absolute-names --only-values -n system.LOCATIONS ".escapeshellarg($attr[1]))):''];
|
||||
}
|
||||
// sort by input 'field'
|
||||
if ($field=='name') {
|
||||
$type = array();
|
||||
$name = array();
|
||||
$type = []; $name = [];
|
||||
foreach ($list as $row) {
|
||||
$type[] = $row['type'];
|
||||
$name[] = strtolower($row['name']);
|
||||
}
|
||||
array_multisort($type,$opt, $name,$opt, $list);
|
||||
} else {
|
||||
$type = array();
|
||||
$indx = array();
|
||||
$name = array();
|
||||
$type = []; $indx = []; $name = [];
|
||||
foreach ($list as $row) {
|
||||
$type[] = $row['type'];
|
||||
$indx[] = $row[$field];
|
||||
|
||||
@@ -16,8 +16,9 @@ Cond="($var['fsState']=='Stopped' || $var['cacheSbNumDisks'])"
|
||||
?>
|
||||
<script>
|
||||
function cache_status() {
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'cache'},function(data) {
|
||||
if (data) $('#cache_device').html(data);
|
||||
var diskio = $.cookie('diskio')===undefined ? 0 : 1;
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'cache'<?if ($tabbed):?>,diskio:diskio<?endif?>},function(data) {
|
||||
if (data) {$('#cache_device').html(data); display_diskio();}
|
||||
<?if ($update && $var['fsState']=='Started'):?>
|
||||
<?if ($tabbed):?>
|
||||
if ($('#tab2').is(':checked')) timer = setTimeout(cache_status,<?=abs($display['refresh'])?>);
|
||||
@@ -28,7 +29,9 @@ function cache_status() {
|
||||
});
|
||||
}
|
||||
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
|
||||
$('#tab2').bind({click:function() {clearTimeout(timer); cache_status();}});
|
||||
$('#tab2').bind({click:function() {clearTimeout(timer); cache_status(); $('i.toggle').show('slow');}});
|
||||
<?else:?>
|
||||
$('#tab2').bind({click:function() {$('i.toggle').show('slow');}});
|
||||
<?endif;?>
|
||||
|
||||
cache_status();
|
||||
|
||||
@@ -60,5 +60,5 @@ Min. free space:
|
||||
> **2000000** => 2,048,000,000 bytes
|
||||
|
||||
|
||||
: <input type="submit" name="changeShare" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be **Stopped** to change<?endif;?>
|
||||
: <input type="submit" name="changeShare" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be <span class="strong big">Stopped</span> to change<?endif;?>
|
||||
</form>
|
||||
|
||||
@@ -112,9 +112,6 @@ function active_disks($disk) {
|
||||
$disks = array_filter($disks,'active_disks');
|
||||
$slots = count($disks) + count($devs);
|
||||
?>
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
|
||||
<script src="/webGui/javascript/context.js"></script>
|
||||
|
||||
<table class='share_status fixed'>
|
||||
<thead><tr>
|
||||
<?
|
||||
@@ -172,7 +169,7 @@ echo "<td>Array Status</td>".implode('',$row0);
|
||||
<?=mk_option("", "1", "Counters")?>
|
||||
<?=mk_option("", "2", "Errors")?>
|
||||
</select>
|
||||
</td></tr><tr><td colspan='4'><center>Load Statistics</center></td></tr></thead>
|
||||
</td></tr><tr><td colspan='4' style='text-align:center'>Load Statistics</td></tr></thead>
|
||||
<tbody>
|
||||
<tr class='wide'><td>Avg. CPU load</td><td colspan='3'><div class='usage-disk sys'><span id='cpu' style='width:0'></span></div></td></tr>
|
||||
</tbody>
|
||||
@@ -355,7 +352,7 @@ foreach ($shares as $name => $share):
|
||||
$security = export_settings($var['shareSMBEnabled'], $sec[$name]);
|
||||
echo "<tr><td>$list</td><td>$comment</td><td>$security</td><td class='blue' id='share{$i}'>0</td></tr>";
|
||||
endforeach;
|
||||
if (!count($shares)) echo "<tr><td colspan='4'><center>No shares present</center></td></tr>";
|
||||
if (!count($shares)) echo "<tr><td colspan='4' style='text-align:center;padding-top:12px'>No shares present</td></tr>";
|
||||
?>
|
||||
</tbody>
|
||||
<?endif;?>
|
||||
@@ -368,7 +365,7 @@ foreach ($shares as $name => $share):
|
||||
$security = export_settings($var['shareAFPEnabled'], $sec_afp[$name]);
|
||||
echo "<tr><td>$list</td><td>$comment</td><td>$security</td><td>-</td></tr>";
|
||||
endforeach;
|
||||
if (!count($shares)) echo "<tr><td colspan='4'><center>No shares present</center></td></tr>";
|
||||
if (!count($shares)) echo "<tr><td colspan='4' style='text-align:center;padding-top:12px'>No shares present</td></tr>";
|
||||
?>
|
||||
</tbody>
|
||||
<?endif;?>
|
||||
@@ -381,7 +378,7 @@ foreach ($shares as $name => $share):
|
||||
$security = export_settings($var['shareNFSEnabled'], $sec_nfs[$name]);
|
||||
echo "<tr><td>$list</td><td>$comment</td><td>$security</td><td>-</td></tr>";
|
||||
endforeach;
|
||||
if (!count($shares)) echo "<tr><td colspan='4'><center>No shares present</center></td></tr>";
|
||||
if (!count($shares)) echo "<tr><td colspan='4' style='text-align:center;padding-top:12px'>No shares present</td></tr>";
|
||||
?>
|
||||
</tbody>
|
||||
<?endif;?>
|
||||
@@ -393,7 +390,7 @@ foreach ($shares as $name => $share):
|
||||
$comment = truncate($share['comment'],28);
|
||||
echo "<tr><td>$list</td><td>$comment</td><td>-</td><td>-</td></tr>";
|
||||
endforeach;
|
||||
if (!count($shares)) echo "<tr><td colspan='4'><center>No shares present</center></td></tr>";
|
||||
if (!count($shares)) echo "<tr><td colspan='4' style='text-align:center;padding-top:12px'>No shares present</td></tr>";
|
||||
?>
|
||||
</tbody>
|
||||
<?endif;?>
|
||||
@@ -459,15 +456,20 @@ function update30() {
|
||||
clearTimeout(timer2);
|
||||
timer2 = setTimeout(heatAlarm,2000);
|
||||
$('[id^="smart-"]').each(function() {
|
||||
var opts = [];
|
||||
var opts = [{header:$(this).attr('id'), image:'/webGui/icons/smart.png'}];
|
||||
var id = '#'+$(this).attr('id');
|
||||
var page = $(this).attr('name');
|
||||
var view = $(this).attr('class');
|
||||
var disk = id.substr(id.indexOf('-')+1);
|
||||
opts.push({text:'Attributes',icon:'fa-sitemap',action:function(e){e.preventDefault();attributes(page,disk);}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'Capabilities',icon:'fa-user',action:function(e){e.preventDefault();capabilities(page,disk);}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'Identity',icon:'fa-home',action:function(e){e.preventDefault();identity(page,disk);}});
|
||||
if (view == 'alert') opts.push({text:'Acknowledge',icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}});
|
||||
if (view == 'alert') {
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'Acknowledge',icon:'fa-check-square-o',action:function(e){e.preventDefault();acknowledge(disk);}});
|
||||
}
|
||||
context.attach(id,opts);
|
||||
});
|
||||
timer30 = setTimeout(update30,30000);
|
||||
|
||||
@@ -5,7 +5,6 @@ Markdown="false"
|
||||
---
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.ui.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
|
||||
<style>
|
||||
body{-webkit-overflow-scrolling: touch;}
|
||||
label{display:inline;}
|
||||
@@ -41,23 +40,23 @@ div.Panel:hover{overflow:visible;z-index:10;}
|
||||
<span class="status" style="margin-top:-44px; margin-right:<?= ($display['refresh']==0 || ($display['refresh']<0 && $var['mdResync']>0)) ? '60' : '0' ?>px"><input type="checkbox" class="appview"></span>
|
||||
<div id="apps_icons" style="display:none">
|
||||
<?
|
||||
$allContainers = array();
|
||||
$allContainers = [];
|
||||
if ((pgrep('docker')!==false) && (empty($display['dashapps']) || $display['dashapps'] == 'icons' || $display['dashapps'] == 'docker')) {
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php';
|
||||
require_once "$docroot/plugins/dynamix.docker.manager/include/DockerClient.php";
|
||||
$DockerClient = new DockerClient();
|
||||
$DockerUpdate = new DockerUpdate();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
|
||||
$allContainers = $DockerClient->getDockerContainers();
|
||||
if ( ! $allContainers) { $allContainers = array(); }
|
||||
if ( ! $allContainers) { $allContainers = []; }
|
||||
|
||||
$arrDockerInfo = $DockerTemplates->getAllInfo();
|
||||
}
|
||||
|
||||
$allVMs = array();
|
||||
$allVMs = [];
|
||||
if ((pgrep('libvirtd')!==false) && (empty($display['dashapps']) || $display['dashapps'] == 'icons' || $display['dashapps'] == 'vms')) {
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt.php';
|
||||
require_once '/usr/local/emhttp/plugins/dynamix.vm.manager/classes/libvirt_helpers.php';
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt.php";
|
||||
require_once "$docroot/plugins/dynamix.vm.manager/classes/libvirt_helpers.php";
|
||||
|
||||
$doms = $lv->get_domains();
|
||||
if (is_array($doms)) {
|
||||
@@ -66,7 +65,7 @@ if ((pgrep('libvirtd')!==false) && (empty($display['dashapps']) || $display['das
|
||||
}
|
||||
}
|
||||
|
||||
$contextMenus = array();
|
||||
$contextMenus = [];
|
||||
|
||||
// Docker Apps
|
||||
foreach ($allContainers as $ct) {
|
||||
@@ -149,7 +148,7 @@ foreach ($allVMs as $name) {
|
||||
if (!empty($vmtemplateicon)) {
|
||||
if (file_exists($vmtemplateicon)) {
|
||||
$vmicon = $vmtemplateicon;
|
||||
} else if (file_exists('/usr/local/emhttp/plugins/dynamix.vm.manager/templates/images/' . $vmtemplateicon)) {
|
||||
} else if (file_exists("$docroot/plugins/dynamix.vm.manager/templates/images/" . $vmtemplateicon)) {
|
||||
$vmicon = '/plugins/dynamix.vm.manager/templates/images/' . $vmtemplateicon;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +171,6 @@ foreach ($allVMs as $name) {
|
||||
<div id="noapps">No apps available to show</div>
|
||||
</div>
|
||||
<script src="/webGui/javascript/jquery.switchbutton.js"></script>
|
||||
<script src="/webGui/javascript/context.js"></script>
|
||||
<script src="/plugins/dynamix.docker.manager/javascript/docker.js"></script>
|
||||
<script>
|
||||
function ajaxVMDispatch(currentstate, params){
|
||||
|
||||
@@ -23,7 +23,7 @@ $(function() {
|
||||
</script>
|
||||
<table class='share_status small'>
|
||||
<thead><td style="width:30px">#</td><td>Attribute Name</td><td>Flag</td><td>Value</td><td>Worst</td><td>Threshold</td><td>Type</td><td>Updated</td><td>Failed</td><td style="width:145px">Raw Value</td></thead>
|
||||
<tbody id="disk_attributes"><tr><td colspan='10'><br><center><i class='fa fa-spinner fa-spin'></i> <em>Please wait... retrieving S.M.A.R.T. information!</em></center></td></tr></tbody>
|
||||
<tbody id="disk_attributes"><tr><td colspan='10' style='text-align:center;padding-top:12px'><i class='fa fa-spinner fa-spin'></i> <em>Please wait... retrieving S.M.A.R.T. information!</em></td></tr></tbody>
|
||||
</table>
|
||||
<input type="button" value="Done" onclick="done()">
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ $(function() {
|
||||
</script>
|
||||
<table class='share_status small'>
|
||||
<thead><td style="width:33%">Feature</td><td>Value</td><td>Information</td></thead>
|
||||
<tbody id="disk_capabilities"><tr><td colspan='3'><br><center><i class='fa fa-spinner fa-spin'></i> <em>Please wait... retrieving S.M.A.R.T. information!</em></center></td></tr></tbody>
|
||||
<tbody id="disk_capabilities"><tr><td colspan='3' style='text-align:center;padding-top:12px'><i class='fa fa-spinner fa-spin'></i> <em>Please wait... retrieving S.M.A.R.T. information!</em></td></tr></tbody>
|
||||
</table>
|
||||
<input type="button" value="Done" onclick="done()">
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ $(function() {
|
||||
</script>
|
||||
<table class='share_status small'>
|
||||
<thead><td style="width:33%">Title</td><td>Information</td></thead>
|
||||
<tbody id="disk_identify"><tr><td colspan='2'><br><center><i class='fa fa-spinner fa-spin'></i> <em>Please wait... retrieving S.M.A.R.T. information!</em></center></td></tr></tbody>
|
||||
<tbody id="disk_identify"><tr><td colspan='2' style='text-align:center;padding-top:12px'><i class='fa fa-spinner fa-spin'></i> <em>Please wait... retrieving S.M.A.R.T. information!</em></td></tr></tbody>
|
||||
</table>
|
||||
<input type="button" value="Done" onclick="done()">
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ $(function() {
|
||||
|
||||
<form markdown="1" method="POST" action="/update.htm" target="progressFrame" onsubmit="doDispatch(this)">
|
||||
Name:
|
||||
: <big><?=my_disk($name)?></big>
|
||||
: <span class='big'><?=my_disk($name)?></span>
|
||||
|
||||
Partition size:
|
||||
: <?=my_number($disk['size'])?> KB (K=1024)
|
||||
@@ -123,7 +123,7 @@ File system type:
|
||||
<?=mk_option($disk['fsType'], "btrfs", "btrfs")?>
|
||||
<?=mk_option($disk['fsType'], "reiserfs", "reiserfs")?>
|
||||
<?=mk_option($disk['fsType'], "xfs", "xfs")?>
|
||||
</select> Array must be **Stopped** to change
|
||||
</select> Array must be <span class="strong big">Stopped</span> to change
|
||||
|
||||
<?endif;?>
|
||||
<?elseif ($disk['type']=="Cache" && $var['SYS_CACHE_SLOTS']>1):?>
|
||||
@@ -209,7 +209,7 @@ btrfs filesystem df:
|
||||
<?if ($var['cacheSbNumDisks']>1):?>
|
||||
<form markdown="1" method="POST" action="/update.php" target="progressFrame">
|
||||
<?if ($disk['fsStatus']=="Mounted"):?>
|
||||
<?exec("/usr/local/emhttp/webGui/scripts/btrfs_balance status /mnt/{$disk['name']}", $balance_status, $retval);?>
|
||||
<?exec("$docroot/webGui/scripts/btrfs_balance status /mnt/{$disk['name']}", $balance_status, $retval);?>
|
||||
|
||||
<div id="title" class="nocontrol"><span class="left"><img src="/plugins/dynamix/icons/balancestatus.png" class="icon">Balance Status</span></div>
|
||||
|
||||
@@ -253,7 +253,7 @@ btrfs balance status:
|
||||
<?if ($disk['fsType']=="btrfs"):?>
|
||||
<form markdown="1" method="POST" action="/update.php" target="progressFrame">
|
||||
<?if ($disk['fsStatus']=="Mounted"):?>
|
||||
<?exec("/usr/local/emhttp/webGui/scripts/btrfs_scrub status /mnt/{$disk['name']}", $scrub_status, $retval);?>
|
||||
<?exec("$docroot/webGui/scripts/btrfs_scrub status /mnt/{$disk['name']}", $scrub_status, $retval);?>
|
||||
|
||||
<div id="title" class="nocontrol"><span class="left"><img src="/plugins/dynamix/icons/scrubstatus.png" class="icon">Scrub Status</span></div>
|
||||
|
||||
@@ -297,7 +297,7 @@ btrfs scrub status:
|
||||
<?if ($disk['fsType']=="reiserfs"):?>
|
||||
<form markdown="1" method="POST" action="/update.php" target="progressFrame">
|
||||
<?if ($var['fsState']=="Started" && $var['startMode']=='Maintenance'):?>
|
||||
<?exec("/usr/local/emhttp/webGui/scripts/reiserfs_check status /dev/{$disk['deviceSb']} {$disk['id']}", $check_status, $retval);?>
|
||||
<?exec("$docroot/webGui/scripts/reiserfs_check status /dev/{$disk['deviceSb']} {$disk['id']}", $check_status, $retval);?>
|
||||
|
||||
<div id="title" class="nocontrol"><span class="left"><img src="/plugins/dynamix/icons/filesystemstatus.png" class="icon">Check Filesystem Status</span></div>
|
||||
|
||||
@@ -349,7 +349,7 @@ reiserfsck status:
|
||||
<?if ($disk['fsType']=="xfs"):?>
|
||||
<form markdown="1" method="POST" action="/update.php" target="progressFrame">
|
||||
<?if ($var['fsState']=="Started" && $var['startMode']=='Maintenance'):?>
|
||||
<?exec("/usr/local/emhttp/webGui/scripts/xfs_check status /dev/{$disk['deviceSb']} {$disk['id']}", $check_status, $retval);?>
|
||||
<?exec("$docroot/webGui/scripts/xfs_check status /dev/{$disk['deviceSb']} {$disk['id']}", $check_status, $retval);?>
|
||||
|
||||
<div id="title" class="nocontrol"><span class="left"><img src="/plugins/dynamix/icons/filesystemstatus.png" class="icon">Check Filesystem Status</span></div>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Type="xmenu"
|
||||
|
||||
<?
|
||||
if (count($pages)==2) $tabbed = false;
|
||||
$refs = array(); $n = 0;
|
||||
$refs = []; $n = 0;
|
||||
|
||||
foreach ($disks as $ref) {
|
||||
if ($ref['type']=='Flash') continue;
|
||||
|
||||
@@ -244,8 +244,10 @@ Show Dashboard apps:
|
||||
|
||||
Dynamix color theme:
|
||||
: <select name="theme" size="1">
|
||||
<?=mk_option($display['theme'], "white", "White")?>
|
||||
<?=mk_option($display['theme'], "black", "Black")?>
|
||||
<?foreach (glob("$docroot/webGui/styles/dynamix-*.css") as $themes):?>
|
||||
<?$theme = substr(basename($themes,'.css'),8);?>
|
||||
<?=mk_option($display['theme'], $theme, ucfirst($theme))?>
|
||||
<?endforeach;?>
|
||||
</select>
|
||||
|
||||
Used / Free columns:
|
||||
|
||||
@@ -16,7 +16,7 @@ Png="ethernet.png"
|
||||
?>
|
||||
<?
|
||||
$build = false;
|
||||
$template = '/usr/local/emhttp/webGui/EthX.page';
|
||||
$template = "$docroot/webGui/EthX.page";
|
||||
$ini = '/var/local/emhttp/network.ini';
|
||||
$validIP = '((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
|
||||
|
||||
@@ -25,7 +25,7 @@ exec("ip -br addr|grep -Po '^eth[1-9]+\s'",$ports);
|
||||
$ports = array_map('trim', $ports);
|
||||
|
||||
// remove non-existing ethernet ports
|
||||
foreach (glob('/usr/local/emhttp/webGui/Eth[1-9]*.page',GLOB_NOSORT) as $port) {
|
||||
foreach (glob("$docroot/webGui/Eth[1-9]*.page",GLOB_NOSORT) as $port) {
|
||||
if (!in_array(strtolower(basename($port,'.page')), $ports)) {
|
||||
@unlink($port);
|
||||
$build = true;
|
||||
@@ -33,7 +33,7 @@ foreach (glob('/usr/local/emhttp/webGui/Eth[1-9]*.page',GLOB_NOSORT) as $port) {
|
||||
}
|
||||
// add new ethernet ports
|
||||
foreach ($ports as $port) {
|
||||
$file = "/usr/local/emhttp/webGui/".ucfirst($port).".page";
|
||||
$file = "$docroot/webGui/".ucfirst($port).".page";
|
||||
if (!file_exists($file)) {
|
||||
copy($template, $file);
|
||||
exec("sed -i 's/x-settings/NetworkSettings/;s/ethX/$port/g' $file");
|
||||
@@ -253,6 +253,8 @@ $(function() {
|
||||
disableForm(form);
|
||||
$('#bond0').dropdownchecklist('disable');
|
||||
$('#bridge0').dropdownchecklist('disable');
|
||||
if (form.DNS_SERVER2.value) $('#dnsserver2').show(); else $('#dnsserver2').hide();
|
||||
if (form.DNS_SERVER3.value) $('#dnsserver3').show(); else $('#dnsserver3').hide();
|
||||
<?else:?>
|
||||
checkDNSSettings(form);
|
||||
<?endif;?>
|
||||
@@ -534,5 +536,5 @@ Network mask:
|
||||
</script>
|
||||
|
||||
|
||||
: <input type="submit" value="Apply" onclick="$('#wait_eth0').show()"><input type="button" value="Done" onclick="done()"><?=$service ? "$service must be <b>STOPPED</b> to change" : ""?>
|
||||
: <input type="submit" value="Apply" onclick="$('#wait_eth0').show()"><input type="button" value="Done" onclick="done()"><?=$service ? "$service must be <span class='strong big'>Stopped</span> to change" : ""?>
|
||||
</form>
|
||||
|
||||
@@ -263,5 +263,5 @@ Network mask:
|
||||
</script>
|
||||
|
||||
|
||||
: <input type="submit" value="Apply" onclick="$(waitid).show()"><input type="button" value="Done" onclick="done()"><input type="button" name="#shut_ethX" value="Port <?=$cmd?>" onclick="portToggle('ethX','<?=$cmd?>')"><?if ($service) echo "$service must be <b>STOPPED</b> to change"?>
|
||||
: <input type="submit" value="Apply" onclick="$(waitid).show()"><input type="button" value="Done" onclick="done()"><input type="button" name="#shut_ethX" value="Port <?=$cmd?>" onclick="portToggle('ethX','<?=$cmd?>')"><?if ($service) echo "$service must be <span class='strong big'>Stopped</span> to change"?>
|
||||
</form>
|
||||
|
||||
@@ -41,7 +41,7 @@ Model:
|
||||
> This is the server model number.
|
||||
|
||||
|
||||
: <input type="submit" name="changeNames" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be **Stopped** to change<?endif;?>
|
||||
: <input type="submit" name="changeNames" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be <span class="strong big">Stopped</span> to change<?endif;?>
|
||||
</form>
|
||||
<script>
|
||||
$("#NAME").keypress(function(event) {
|
||||
|
||||
@@ -18,8 +18,8 @@ Cond="(($var['shareUser']!='-')&&(isset($disks['cache']))&&($disks['cache']['sta
|
||||
<?
|
||||
$cron = explode(' ',$var['shareMoverSchedule']);
|
||||
$move = $cron[2]!='*' ? 3 : ($cron[4]!='*' ? 2 : (substr($cron[1],0,1)!='*' ? 1 : 0));
|
||||
$mode = array('Hourly','Daily','Weekly','Monthly');
|
||||
$days = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
|
||||
$mode = ['Hourly','Daily','Weekly','Monthly'];
|
||||
$days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
|
||||
?>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -81,5 +81,5 @@ Interface <?=$eth?>:
|
||||
> Deleting the file *network-rules.cfg* from the flash device will restore automatic interface assignment after a system reboot.
|
||||
|
||||
<?if (file_exists('/tmp/network-rules.tmp')):?>
|
||||
<br><span class="error" style="font-size:13px;text-align:center;padding:12px 0">Please <b>REBOOT</b> system to make new rules active</span>
|
||||
<br><span class="error" style="font-size:13px;text-align:center;padding:12px 0">Please <span class="strong big">Reboot</span> system to make new rules active</span>
|
||||
<?endif;?>
|
||||
|
||||
@@ -68,7 +68,7 @@ effect of making it ***impossible*** to rebuild an existing failed drive - you h
|
||||
|
||||
<hr>
|
||||
<form name="newConfig" method="POST" action="/update.htm" target="progressFrame">
|
||||
<input type="hidden" name="cmdInit" value="Apply">
|
||||
<input type="hidden" name="cmdInit" value=" Apply ">
|
||||
<span class="indent">Retain current configuration:</span>
|
||||
<select id="s1" name="preset" size="1" multiple="multiple" style="display:none">
|
||||
<option value=''>All</option>
|
||||
@@ -79,7 +79,7 @@ effect of making it ***impossible*** to rebuild an existing failed drive - you h
|
||||
<br>
|
||||
<span class="indent"><input type="button" name="apply" value=" Apply " onclick="prepareNewConfig(this.form)" disabled><input type="button" value=" Done " onclick="done()"></span>
|
||||
<?if ($disabled):?>
|
||||
<?=$newarray ? 'Array has been <b>RESET</b> (please configure)' : 'Array must be <b>STOPPED</b>'?>
|
||||
<?=$newarray ? "Array has been <span class='strong big'>Reset</span> (please configure)" : "Array must be <span class='strong big'>Stopped</span>"?>
|
||||
<?else:?>
|
||||
<input type="checkbox" onClick="apply.disabled=!this.checked"><small>Yes I want to do this</small>
|
||||
<?endif;?>
|
||||
|
||||
@@ -72,7 +72,7 @@ Closing the window before completion will terminate the background process - so
|
||||
|
||||
<input type="submit" name="start" value="Start" disabled><input type="button" value=" Done " onclick="done()">
|
||||
<?if ($var['fsState']!="Started"):?>
|
||||
Array must be <strong>STARTED</strong> to change permissions.
|
||||
Array must be <span class="strong big">Started</span> to change permissions.
|
||||
<?else:?>
|
||||
<input type="checkbox" onClick="start.disabled=!this.checked"><small>Yes I want to do this</small>
|
||||
<?endif;?>
|
||||
|
||||
@@ -88,6 +88,18 @@ $(function(){
|
||||
<input type="hidden" name="plugin">
|
||||
<input type="hidden" name="docker_notify">
|
||||
<input type="hidden" name="report">
|
||||
Notifications display:
|
||||
: <select name="display" size="1">
|
||||
<?=mk_option($notify['display'], "0", "Detailed")?>
|
||||
<?=mk_option($notify['display'], "1", "Summarized")?>
|
||||
</select>
|
||||
|
||||
> In *Detailed* view all notifications will be displayed on screen as soon as they arrive.<br>
|
||||
> Notifications can be acknowledged individually or all in once.
|
||||
>
|
||||
> In *Summarized* view notifications will be counted only and the number of unread notifications is shown in the menu header per category.<br>
|
||||
> Click on the counters to either acknowledge or view the unread notifications.
|
||||
|
||||
Date format:
|
||||
: <select name="date" size="1">
|
||||
<?=mk_option($notify['date'], "d-m-Y", "DD-MM-YYYY")?>
|
||||
|
||||
@@ -41,7 +41,7 @@ function resize(bind) {
|
||||
}
|
||||
<?endif;?>
|
||||
function archiveList(init) {
|
||||
$.get('/webGui/include/NotificationsArchive.php',function(data) {
|
||||
$.get('/webGui/include/NotificationsArchive.php',{filter:'<?=$_GET['filter']?>'},function(data) {
|
||||
if (data) $('#archive_list').html(data);
|
||||
if (init) {
|
||||
<?if ($display['resize']):?>
|
||||
|
||||
@@ -19,8 +19,9 @@ $tabX = '#tab'.($var['fsState']=='Stopped'||is_dir('/mnt/cache') ? '4' : '3');
|
||||
?>
|
||||
<script>
|
||||
function open_status() {
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'open'},function(data) {
|
||||
if (data) $('#open_devices').html(data);
|
||||
var diskio = $.cookie('diskio')===undefined ? 0 : 1;
|
||||
$.post('/webGui/include/DeviceList.php',{path:'<?=$path?>',device:'open'<?if ($tabbed):?>,diskio:diskio<?endif?>},function(data) {
|
||||
if (data) {$('#open_devices').html(data); display_diskio();}
|
||||
<?if ($update && $var['fsState']=='Started'):?>
|
||||
<?if ($tabbed):?>
|
||||
if ($('<?=$tabX?>').is(':checked')) timer = setTimeout(open_status,<?=abs($display['refresh'])?>);
|
||||
@@ -31,7 +32,9 @@ function open_status() {
|
||||
});
|
||||
}
|
||||
<?if ($update && $var['fsState']=='Started' && $tabbed):?>
|
||||
$('<?=$tabX?>').bind({click:function() {clearTimeout(timer); open_status();}});
|
||||
$('<?=$tabX?>').bind({click:function() {clearTimeout(timer); open_status(); $('i.toggle').show('slow');}});
|
||||
<?else:?>
|
||||
$('<?=$tabX?>').bind({click:function() {$('i.toggle').show('slow');}});
|
||||
<?endif;?>
|
||||
|
||||
open_status();
|
||||
|
||||
@@ -16,9 +16,9 @@ Cond="($disks['parity']['status']!='DISK_NP_DSBL')"
|
||||
?>
|
||||
|
||||
<?
|
||||
$mode = array('Disabled','Daily','Weekly','Monthly','Yearly','Custom');
|
||||
$days = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
|
||||
$months = array('January','February','March','April','May','June','July','August','September','October','November','December');
|
||||
$mode = ['Disabled','Daily','Weekly','Monthly','Yearly','Custom'];
|
||||
$days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
|
||||
$months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
|
||||
$memory = '/tmp/memory.tmp';
|
||||
if (file_exists($memory)) {
|
||||
parse_str(file_get_contents($memory), $parity);
|
||||
|
||||
@@ -17,11 +17,14 @@ Type="xmenu"
|
||||
function my_time2($time) {
|
||||
return $time ? my_time($time) : "Anytime";
|
||||
}
|
||||
$device = my_word($var['deviceCount']);
|
||||
$plural = $var['deviceCount']==1 ? '' : 's';
|
||||
?>
|
||||
<style>
|
||||
.thanks{padding-left:10px;color:#6FA239;font-weight:bold;}
|
||||
.thanks.red{color:#CC0000;}
|
||||
.remark{padding:0 10px;text-align:justify;}
|
||||
span.thanks{padding-left:10px;color:#6FA239;font-weight:bold;}
|
||||
span.thanks.red{color:#F0000C;}
|
||||
span.device{font-weight:normal;font-style:italic;}
|
||||
div.remark{padding:0 10px;text-align:justify;}
|
||||
</style>
|
||||
|
||||
<?if (strstr($var['regTy'], "error")):?>
|
||||
@@ -55,7 +58,7 @@ GUID is not uninque (this is common with USB card readers).
|
||||
<?if (strstr($var['regTy'], "invalid key")):?>
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="TrialGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
<span class='thanks red'>The registered GUID does not match the USB Flash boot device GUID</span>
|
||||
|
||||
@@ -66,7 +69,7 @@ Registered GUID:
|
||||
: <?=$var['regGUID'];?>
|
||||
|
||||
Registered to:
|
||||
: <big><?=$var['regTo'];?></big>
|
||||
: <span class="big"><?=$var['regTo'];?></span>
|
||||
|
||||
Registered on:
|
||||
: <?=my_time($var['regTm']);?>
|
||||
@@ -76,7 +79,7 @@ Registered on:
|
||||
Expiration:
|
||||
: <?=my_time($var['regTm2']);?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key">
|
||||
|
||||
<?else:?>
|
||||
@@ -86,12 +89,12 @@ Replaceable:
|
||||
|
||||
<?if ($var['regTm2']==0 || $var['regTm2']<time()):?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key"> <input type="button" value="Replace Key" onclick="openBox('/webGui/include/ReplaceKey.php','Replace Key',600,900);">
|
||||
|
||||
<?else:?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key"> <input type="button" value="Replace Key" disabled>
|
||||
|
||||
<?endif;?>
|
||||
@@ -102,7 +105,7 @@ Replaceable:
|
||||
<?if (strstr($var['regTy'], "invalid installation")):?>
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="TrialGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
<span class='thanks red'>Invalid <em>Trial</em> Installation</span>
|
||||
|
||||
@@ -113,7 +116,7 @@ Registered GUID:
|
||||
: <?=$var['regGUID'];?>
|
||||
|
||||
Registered to:
|
||||
: <big><?=$var['regTo'];?></big>
|
||||
: <span class="big"><?=$var['regTo'];?></span>
|
||||
|
||||
Registered on:
|
||||
: <?=my_time($var['regTm']);?>
|
||||
@@ -121,7 +124,7 @@ Registered on:
|
||||
Expiration:
|
||||
: <?=my_time($var['regTm2']);?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key">
|
||||
|
||||
</form>
|
||||
@@ -130,7 +133,7 @@ Expiration:
|
||||
<?if (strstr($var['regTy'], "missing")):?>
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="TrialGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
<span class='thanks red'>Wrong or Missing Key file.</span>
|
||||
|
||||
@@ -140,7 +143,7 @@ Flash GUID:
|
||||
Registered GUID:
|
||||
: <?=$var['regGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key">
|
||||
|
||||
</form>
|
||||
@@ -149,12 +152,12 @@ Registered GUID:
|
||||
<?if (strstr($var['regTy'], "unregistered")):?>
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="TrialGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
<span class="thanks">Thank you for trying unRAID Server OS!</span>
|
||||
|
||||
<div markdown="1" class="remark">
|
||||
Your server will not be usable until you purchase a registration key or install a <big>**free** 30-day *Trial*</big> key.
|
||||
Your server will not be usable until you purchase a registration key or install a <span class="big">**free** 30-day *Trial*</span> key.
|
||||
<br>Registration keys are bound to your USB Flash boot device GUID (serial number). Please use a high-quality device
|
||||
between 512MB and 32GB in size.
|
||||
|
||||
@@ -167,7 +170,7 @@ between 512MB and 32GB in size.
|
||||
Flash GUID:
|
||||
: <?=$var['flashGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key"> <input type="button" value="Get Trial Key" onclick="openBox('/webGui/include/TrialRequest.php','Get Trial Key',600,900);">
|
||||
|
||||
</form>
|
||||
@@ -176,7 +179,7 @@ Flash GUID:
|
||||
<?if (strstr($var['regTy'], "expired")):?>
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="TrialGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
<span class="thanks">Thank you for trying unRAID Server OS!</span>
|
||||
|
||||
@@ -191,7 +194,7 @@ To continue using unRAID Server OS you may purchase a registration key. Alternat
|
||||
Flash GUID:
|
||||
: <?=$var['flashGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key"> <input type="button" value="Request Extension" onclick="openBox('/webGui/include/TrialRequest.php','Request Trial Extension Key',600,900);">
|
||||
|
||||
</form>
|
||||
@@ -200,7 +203,7 @@ Flash GUID:
|
||||
<?if ($var['regTy']=="Trial"):?>
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="TrialGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
<span class="thanks">Thank you for trying unRAID Server OS!</span>
|
||||
|
||||
@@ -210,7 +213,7 @@ Flash GUID:
|
||||
Flash GUID:
|
||||
: <?=$var['flashGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Purchase Key">
|
||||
|
||||
</form>
|
||||
@@ -221,7 +224,7 @@ Flash GUID:
|
||||
<span class="thanks">Thank you for choosing unRAID Server OS!</span>
|
||||
|
||||
Registered to:
|
||||
: <big><?=$var['regTo'];?></big>
|
||||
: <span class="big"><?=$var['regTo'];?></span>
|
||||
|
||||
Registered on:
|
||||
: <?=my_time($var['regTm']);?>
|
||||
@@ -231,12 +234,12 @@ Replaceable:
|
||||
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="BasicGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
Flash GUID:
|
||||
: <?=$var['flashGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Upgrade">
|
||||
|
||||
</form>
|
||||
@@ -247,7 +250,7 @@ Flash GUID:
|
||||
<span class="thanks">Thank you for choosing unRAID Server OS!</span>
|
||||
|
||||
Registered to:
|
||||
: <big><?=$var['regTo'];?></big>
|
||||
: <span class="big"><?=$var['regTo'];?></span>
|
||||
|
||||
Registered on:
|
||||
: <?=my_time($var['regTm']);?>
|
||||
@@ -257,12 +260,12 @@ Replaceable:
|
||||
|
||||
<form markdown="1" method="GET" action="https://lime-technology.com/getkey" target="_blank">
|
||||
<input type="hidden" name="PlusGUID" value="<?=$var['flashGUID'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount'];?>">
|
||||
<input type="hidden" name="deviceCount" value="<?=$var['deviceCount']?>">
|
||||
|
||||
Flash GUID:
|
||||
: <?=$var['flashGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="submit" value="Upgrade">
|
||||
|
||||
</form>
|
||||
@@ -273,7 +276,7 @@ Flash GUID:
|
||||
<span class="thanks">Thank you for choosing unRAID Server OS!</span>
|
||||
|
||||
Registered to:
|
||||
: <big><?=$var['regTo'];?></big>
|
||||
: <span class="big"><?=$var['regTo'];?></span>
|
||||
|
||||
Registered on:
|
||||
: <?=my_time($var['regTm']);?>
|
||||
@@ -284,7 +287,7 @@ Replaceable:
|
||||
Flash GUID:
|
||||
: <?=$var['flashGUID'];?>
|
||||
|
||||
<?=$var['deviceCount'];?> Attached storage device(s)
|
||||
<span class="device">This system has <?=$device?> attached storage device<?=$plural?>.</span>
|
||||
: <input type="button" value="Done" onclick="done()">
|
||||
|
||||
<?else:?>
|
||||
|
||||
@@ -41,7 +41,7 @@ Hide "dot" files:
|
||||
|
||||
<?if ($var['fsState']=="Started"):?>
|
||||
|
||||
: <input type="submit" name="changeShare" value="Apply" disabled><input type="button" value="Done" onclick="done()">Array must be **Stopped** to change
|
||||
: <input type="submit" name="changeShare" value="Apply" disabled><input type="button" value="Done" onclick="done()">Array must be <span class="strong big">Stopped</span> to change
|
||||
<?else:?>
|
||||
|
||||
: <input type="submit" name="changeShare" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
|
||||
@@ -29,7 +29,7 @@ $(checkShareSettingsAFP);
|
||||
<input type="hidden" name="shareName" value="<?=$name;?>">
|
||||
|
||||
Share name:
|
||||
: <big><?=$name?></big>
|
||||
: <span class="big"><?=$name?></span>
|
||||
|
||||
Export:
|
||||
: <select name="shareExportAFP" size="1" onchange="checkShareSettingsAFP()">
|
||||
|
||||
@@ -18,7 +18,7 @@ Cond="(($var['shareNFSEnabled']!='no') && (isset($name)?array_key_exists($name,$
|
||||
<input type="hidden" name="shareName" value="<?=$name;?>">
|
||||
|
||||
Share name:
|
||||
: <big><?=$name?></big>
|
||||
: <span class="big"><?=$name?></span>
|
||||
|
||||
Export:
|
||||
: <select name="shareExportNFS" size="1">
|
||||
|
||||
@@ -47,7 +47,7 @@ if (isset($disks[$name])) {
|
||||
<input type="hidden" name="shareName" value="<?=$name?>">
|
||||
|
||||
Share name:
|
||||
: <big><?=$name?></big>
|
||||
: <span class="big"><?=$name?></span>
|
||||
|
||||
Export:
|
||||
: <select name="shareExport" size="1">
|
||||
|
||||
@@ -14,7 +14,7 @@ Type="xmenu"
|
||||
?>
|
||||
<?if ($name):?>
|
||||
<?
|
||||
$refs = array(); $n = 0;
|
||||
$refs = []; $n = 0;
|
||||
|
||||
foreach ($shares as $ref) {
|
||||
$sname = $ref['name'];
|
||||
|
||||
@@ -17,16 +17,16 @@ Title="Share Settings"
|
||||
<?
|
||||
if ($name == "") {
|
||||
/* default values when adding new share */
|
||||
$share = array("nameOrig" => "",
|
||||
"name" => "",
|
||||
"comment" => "",
|
||||
"allocator" => "highwater",
|
||||
"floor" => "",
|
||||
"splitLevel" => "",
|
||||
"include" => "",
|
||||
"exclude" => "",
|
||||
"useCache" => "no",
|
||||
"cow" => "auto");
|
||||
$share = ["nameOrig" => "",
|
||||
"name" => "",
|
||||
"comment" => "",
|
||||
"allocator" => "highwater",
|
||||
"floor" => "",
|
||||
"splitLevel" => "",
|
||||
"include" => "",
|
||||
"exclude" => "",
|
||||
"useCache" => "no",
|
||||
"cow" => "auto"];
|
||||
} else if (array_key_exists($name, $shares)) {
|
||||
/* edit existing share */
|
||||
$share = $shares[$name];
|
||||
@@ -354,7 +354,7 @@ Enable Copy-on-write:
|
||||
: <input type="submit" name="cmdEditShare" value="Add Share"><input type="button" value="Done" onclick="done()">
|
||||
<?elseif (shareEmpty($name)):?>
|
||||
Share status:
|
||||
: <big>Share is empty</big>
|
||||
: <span class="big">Share is empty</span>
|
||||
|
||||
> Share does *not* contain any data and may be deleted if not needed any longer.
|
||||
|
||||
@@ -362,7 +362,7 @@ Delete<input type="checkbox" name="confirmDelete" onchange="chkDelete(this.form,
|
||||
: <input type="submit" name="cmdEditShare" value="Apply"><input type="button" value="Done" onclick="done()">
|
||||
<?else:?>
|
||||
Share status:
|
||||
: <big>Share contains data</big>
|
||||
: <span class="big">Share contains data</span>
|
||||
|
||||
> Share can *not* be deleted as long as it contains data. Be aware that some data can be hidden. See also [SMB Settings](/Settings/SMB) -> Hide "dot" files.
|
||||
|
||||
|
||||
@@ -121,6 +121,6 @@ Tunable (enable Direct IO):
|
||||
> *Auto* selects No.
|
||||
|
||||
|
||||
: <input type="submit" name="changeShare" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be **Stopped** to change<?endif;?>
|
||||
: <input type="submit" name="changeShare" value="Apply" <?=$disabled?>><input type="button" value="Done" onclick="done()"><?if ($disabled):?>Array must be <span class="strong big">Stopped</span> to change<?endif;?>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -3,7 +3,7 @@ Type="xmenu"
|
||||
----
|
||||
<?PHP
|
||||
if ($var['fsState']!="Started") {
|
||||
echo "<p class='notice'>Array must be <strong><big>started</big></strong> to view Shares.</p>";
|
||||
echo "<p class='notice'>Array must be <span class='strong big'>started</span> to view Shares.</p>";
|
||||
return;
|
||||
}
|
||||
if (count($pages)==2) $tabbed = false;
|
||||
|
||||
@@ -14,7 +14,7 @@ Title="SMTP Settings"
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'webGui/include/Encryption.php';
|
||||
require_once "$docroot/webGui/include/Encryption.php";
|
||||
|
||||
$ssmtp['AuthPass'] = base64_decrypt($ssmtp['AuthPass']);
|
||||
$incomplete = strlen($ssmtp['root'])==0 || strlen($ssmtp['server'])==0 || strlen($ssmtp['port'])==0 || ((strlen($ssmtp['AuthUser'])==0 || strlen($ssmtp['AuthPass'])==0) && $ssmtp['AuthMethod']!='none');
|
||||
|
||||
@@ -65,7 +65,7 @@ $(function() {
|
||||
$('.tabs').append("<span class='status'><span class='lite label'><label>Text<input type='checkbox' class='ctrl' onclick='highlight(!this.checked,\"N\")' checked></label></span><span class='error label'><label>Error<input type='checkbox' onclick='highlight(this.checked,\"E\")' checked></label></span><span class='warn label'><label>Warning<input type='checkbox' onclick='highlight(this.checked,\"W\")' checked></label></span><span class='system label'><label>System<input type='checkbox' onclick='highlight(this.checked,\"S\")' checked></label></span><span class='array label'><label>Array<input type='checkbox' onclick='highlight(this.checked,\"A\")' checked></label></span><span class='login label'><label>Login<input type='checkbox' onclick='highlight(this.checked,\"L\")' checked></label></span><span class='lite label'><input type='checkbox' class='ctrl' onclick='toggle(this.checked)' checked></span></span>");
|
||||
</script>
|
||||
<?
|
||||
require_once 'webGui/include/ColorCoding.php';
|
||||
require_once "$docroot/webGui/include/ColorCoding.php";
|
||||
|
||||
echo $display['resize'] ? "<pre class='up' style='display:none'>" : "<pre class='up'>";
|
||||
$logs = glob('/var/log/syslog*',GLOB_NOSORT);
|
||||
|
||||
@@ -19,7 +19,7 @@ if ($submenu) $path = './Users';
|
||||
?>
|
||||
<?foreach ($users as $user):?>
|
||||
<?$img = "/boot/config/plugins/dynamix/users/{$user['name']}.png"?>
|
||||
<div class="user-list"><center><a class="<?=(!empty($user['desc']) ? 'info' : '')?>" href="<?=$path?>/UserEdit?name=<?=$user['name'];?>"><img src="<?=(file_exists($img) ? autov($img) : '/webGui/images/user.png')?>" class="picture" border="0" width="48" height="48"><br><?=$user['name']?><span><?=$user['desc']?></span></a></center></div>
|
||||
<div class="user-list" style="text-align:center"><a class="<?=(!empty($user['desc']) ? 'info' : '')?>" href="<?=$path?>/UserEdit?name=<?=$user['name'];?>"><img src="<?=(file_exists($img) ? autov($img) : '/webGui/images/user.png')?>" class="picture" border="0" width="48" height="48"><br><?=$user['name']?><span><?=$user['desc']?></span></a></div>
|
||||
<?endforeach;?>
|
||||
<div style='clear:both'></div>
|
||||
<form method="GET" action="<?=$path?>/UserAdd">
|
||||
|
||||
@@ -33,6 +33,7 @@ day="0"
|
||||
cron=""
|
||||
write=""
|
||||
[notify]
|
||||
display="0"
|
||||
date="d-m-Y"
|
||||
time="H:i"
|
||||
position="top-right"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 798 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
function normalize($type,$count) {
|
||||
$words = explode('_',$type);
|
||||
foreach ($words as &$word) $word = $word==strtoupper($word) ? $word : preg_replace(['/^(ct|cnt)$/','/^blk$/'],['count','block'],strtolower($word));
|
||||
@@ -25,10 +27,11 @@ function my_smart(&$source,$name,$page) {
|
||||
$select = isset($disk['smSelect']) ? $disk['smSelect'] : -1; if ($select==-1) $select = isset($var['smSelect']) ? $var['smSelect'] : 0;
|
||||
$level = isset($disk['smLevel']) ? $disk['smLevel'] : -1; if ($level==-1) $level = isset($var['smLevel']) ? $var['smLevel'] : 1;
|
||||
$events = isset($disk['smEvents']) ? explode('|',$disk['smEvents']) : (isset($var['smEvents']) ? explode('|',$var['smEvents']) : $numbers);
|
||||
$thumb = 'good';
|
||||
$title = '';
|
||||
$thumb = 'good';
|
||||
$file = "state/smart/$name";
|
||||
if (file_exists("$file.ssa") && in_array(file_get_contents("$file.ssa"),$failed)) {
|
||||
$thumb = 'bad';
|
||||
$title = "S.M.A.R.T health-check failed\n"; $thumb = 'bad';
|
||||
} else {
|
||||
if (empty($saved["smart"]["$name.ack"])) {
|
||||
exec("awk 'NR>7{print $1,$2,$4,$6,$9,$10}' $file 2>/dev/null", $codes);
|
||||
@@ -37,11 +40,13 @@ function my_smart(&$source,$name,$page) {
|
||||
list($id,$class,$value,$thres,$when,$raw) = explode(' ',$code);
|
||||
$fail = strpos($when,'FAILING_NOW')!==false;
|
||||
if (!$fail && !in_array($id,$events)) continue;
|
||||
if ($fail || ($select ? $thres>0 && $value<=$thres*$level : $raw>0)) {$thumb = 'alert'; break;};
|
||||
if ($fail || ($select ? $thres>0 && $value<=$thres*$level : $raw>0)) $title .= normalize($class,$fail?$when:$raw);
|
||||
}
|
||||
if ($title) $thumb = 'alert'; else $title = "No errors reported\n";
|
||||
}
|
||||
}
|
||||
my_insert($source, "<span id='smart-$name' name='$page' class='$thumb'><img src=\"$path/$thumb.png\" onmouseover=\"this.style.cursor='pointer'\" title=\"Click to get context menu\"></span>");
|
||||
$title .= "Click for context menu";
|
||||
my_insert($source, "<span id='smart-$name' name='$page' class='$thumb'><img src=\"$path/$thumb.png\" onmouseover=\"this.style.cursor='pointer'\" title=\"$title\"></span>");
|
||||
}
|
||||
function my_usage(&$source,$used) {
|
||||
my_insert($source, $used ? "<div class='usage-disk all'><span style='width:$used'>$used</span></div>" : "-");
|
||||
@@ -71,8 +76,8 @@ case 'disk':
|
||||
$disks = @array_filter(parse_ini_file('state/disks.ini',true),'active_disks');
|
||||
$devs = @parse_ini_file('state/devs.ini',true);
|
||||
$saved = @parse_ini_file('state/monitor.ini',true);
|
||||
require_once 'CustomMerge.php';
|
||||
require_once 'Preselect.php';
|
||||
require_once "$docroot/webGui/include/CustomMerge.php";
|
||||
require_once "$docroot/webGui/include/Preselect.php";
|
||||
$slots = $_POST['slots'];
|
||||
$row1 = array_fill(0,31,'<td></td>'); my_insert($row1[0],'Active');
|
||||
$row2 = array_fill(0,31,'<td></td>'); my_insert($row2[0],'Inactive');
|
||||
@@ -103,8 +108,11 @@ case 'disk':
|
||||
$temp = $disk['temp'];
|
||||
$hot = strlen($disk['hotTemp']) ? $disk['hotTemp'] : $_POST['hot'];
|
||||
$max = strlen($disk['maxTemp']) ? $disk['maxTemp'] : $_POST['max'];
|
||||
$beep = $temp>=$max && $max>0 ? 'max' : ($temp>=$hot && $hot>0 ? 'hot' : '');
|
||||
if ($beep) my_insert($row5[$n],"<span class='heat-img'><img src='$path/$beep.png'></span><span class='heat-text' style='display:none'>".my_temp($temp,$_POST['unit'])."</span>");
|
||||
$heat = $temp>=$max && $max>0 ? 'max' : ($temp>=$hot && $hot>0 ? 'hot' : '');
|
||||
if ($heat)
|
||||
my_insert($row5[$n],"<span class='heat-img'><img src='$path/$heat.png'></span><span class='heat-text' style='display:none'>".my_temp($temp,$_POST['unit'])."</span>");
|
||||
else
|
||||
if (!strpos($state,'blink') && $temp>0) my_insert($row5[$n],"<span class='temp-text'>".my_temp($temp,$_POST['unit'])."</span>");
|
||||
if ($disk['device'] && !strpos($state,'blink')) my_smart($row6[$n],$disk['name'],'Device');
|
||||
my_usage($row7[$n],($disk['type']!='Parity' && $disk['fsStatus']=='Mounted')?(round((1-$disk['fsFree']/$disk['fsSize'])*100).'%'):'');
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
<meta name="robots" content="noindex">
|
||||
<link type="image/png" rel="shortcut icon" href="/webGui/images/<?=$var['mdColor']?>.png">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/default-fonts.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/font-awesome.css?v=4.5.0">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/font-awesome.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/context.standalone.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.sweetalert.css">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/default-{$display['theme']}.css")?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?autov("/webGui/styles/dynamix-{$display['theme']}.css")?>">
|
||||
@@ -157,27 +158,77 @@ function showNotice(data,plugin) {
|
||||
if (timers.countDown) {clearTimeout(timers.countDown);$('#countdown').html('');}
|
||||
}
|
||||
function notifier() {
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get'},function(data) {
|
||||
if (data) {
|
||||
var json = $.parseJSON(data);
|
||||
$.each(json, function(i, object) {
|
||||
var notify = $.parseJSON(object);
|
||||
$.jGrowl(notify.subject+'<br>'+notify.description, {
|
||||
sticky: true,
|
||||
position: '<?=$notify['position']?>',
|
||||
header: notify.event+': '+notify.timestamp,
|
||||
theme: notify.importance+' '+notify.file,
|
||||
themeState: '',
|
||||
beforeOpen: function(e,m,o) {if ($('.jGrowl-notify').hasClass(notify.file)) {return(false);}},
|
||||
close: function(e,m,o) {$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file}); return(false);}
|
||||
});
|
||||
var tub1 = 0, tub2 = 0, tub3 = 0;
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get'},function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
$.each(data, function(i, object) {
|
||||
var notify = $.parseJSON(object);
|
||||
<?if ($notify['display']):?>
|
||||
switch (notify.importance) {
|
||||
case 'alert' : tub1++; break;
|
||||
case 'warning': tub2++; break;
|
||||
case 'normal' : tub3++; break;
|
||||
}
|
||||
<?else:?>
|
||||
$.jGrowl(notify.subject+'<br>'+notify.description, {
|
||||
group: notify.importance,
|
||||
header: notify.event+': '+notify.timestamp,
|
||||
theme: notify.file,
|
||||
beforeOpen: function(e,m,o){if ($('div.jGrowl-notify').hasClass(notify.file)) return(false);},
|
||||
beforeClose: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file});}
|
||||
});
|
||||
<?if ($update):?>
|
||||
timers.notifier = setTimeout(notifier,<?=max(5000,abs($display['refresh']))?>);
|
||||
<?endif;?>
|
||||
}
|
||||
});
|
||||
<?if ($notify['display']):?>
|
||||
$('#txt-tub1').removeClass('one two three').addClass(digits(tub1)).text(tub1);
|
||||
$('#txt-tub2').removeClass('one two three').addClass(digits(tub2)).text(tub2);
|
||||
$('#txt-tub3').removeClass('one two three').addClass(digits(tub3)).text(tub3);
|
||||
if (tub1) $('#box-tub1').removeClass('grey-text').addClass('red-text'); else $('#box-tub1').removeClass('red-text').addClass('grey-text');
|
||||
if (tub2) $('#box-tub2').removeClass('grey-text').addClass('orange-text'); else $('#box-tub2').removeClass('orange-text').addClass('grey-text');
|
||||
if (tub3) $('#box-tub3').removeClass('grey-text').addClass('green-text'); else $('#box-tub3').removeClass('green-text').addClass('grey-text');
|
||||
<?endif;?>
|
||||
<?if ($update):?>
|
||||
timers.notifier = setTimeout(notifier,5000);
|
||||
<?endif;?>
|
||||
});
|
||||
}
|
||||
function digits(number) {
|
||||
if (number < 10) return 'one';
|
||||
if (number < 100) return 'two';
|
||||
return 'three';
|
||||
}
|
||||
function openNotifier(filter) {
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get'},function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
$.each(data, function(i, object) {
|
||||
var notify = $.parseJSON(object);
|
||||
if (notify.importance == filter) {
|
||||
$.jGrowl(notify.subject+'<br>'+notify.description, {
|
||||
group: notify.importance,
|
||||
header: notify.event+': '+notify.timestamp,
|
||||
theme: notify.file,
|
||||
beforeOpen: function(e,m,o){if ($('div.jGrowl-notify').hasClass(notify.file)) return(false);},
|
||||
beforeClose: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file});}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function closeNotifier(filter) {
|
||||
clearTimeout(timers.notifier);
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get'},function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
$.each(data, function(i, object) {
|
||||
var notify = $.parseJSON(object);
|
||||
if (notify.importance == filter) $.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file});
|
||||
});
|
||||
$('div.jGrowl').find('.'+filter).find('div.jGrowl-close').trigger('click');
|
||||
setTimeout(notifier,100);
|
||||
});
|
||||
}
|
||||
function viewHistory(filter) {
|
||||
location.replace('/Tools/NotificationsArchive?filter='+filter);
|
||||
}
|
||||
function watchdog() {
|
||||
$.post('/webGui/include/Watchdog.php',{mode:<?=$display['refresh']?>,dot:'<?=$display['number'][0]?>'},function(data) {
|
||||
if (data) {
|
||||
@@ -208,7 +259,12 @@ $(function() {
|
||||
if (update>3) timers.countDown = setTimeout(countDown,1000);
|
||||
<?endif;?>
|
||||
updateTime();
|
||||
$.jGrowl.defaults.closer = false;
|
||||
$.jGrowl.defaults.closeTemplate = '<i class="fa fa-share"></i>';
|
||||
$.jGrowl.defaults.closerTemplate = '<?=$notify['position'][0]=='b' ? '<div>':'<div class="top">'?>[ close all notifications ]</div>';
|
||||
$.jGrowl.defaults.sticky = true;
|
||||
$.jGrowl.defaults.check = 100;
|
||||
$.jGrowl.defaults.position = '<?=$notify['position']?>';
|
||||
$.jGrowl.defaults.themeState = '';
|
||||
Shadowbox.setup('a.sb-enable', {modal:true});
|
||||
});
|
||||
var mobiles=['ipad','iphone','ipod','android'];
|
||||
@@ -218,7 +274,7 @@ for (var i=0,mobile; mobile=mobiles[i]; i++) {
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<body class="<?='page_'.strtolower($myPage['name'])?>">
|
||||
<div id="template">
|
||||
<div id="header" class="<?=$display['banner']?>">
|
||||
<div class="logo">
|
||||
@@ -251,13 +307,18 @@ foreach ($pages as $page) {
|
||||
else
|
||||
echo "<div id='{$page['Link']}'></div>";
|
||||
}
|
||||
if ($notify['display']) {
|
||||
echo "<span id='nav-tub1' class='tub'><i id='box-tub1' class='fa fa-square grey-text'></i><span id='txt-tub1' class='score one'>0</span></span>";
|
||||
echo "<span id='nav-tub2' class='tub'><i id='box-tub2' class='fa fa-square grey-text'></i><span id='txt-tub2' class='score one'>0</span></span>";
|
||||
echo "<span id='nav-tub3' class='tub'><i id='box-tub3' class='fa fa-square grey-text'></i><span id='txt-tub3' class='score one'>0</span></span>";
|
||||
}
|
||||
echo "</div></div></div>";
|
||||
|
||||
// Build page content
|
||||
echo "<div class='tabs'>";
|
||||
$tab = 1;
|
||||
$view = $myPage['name'];
|
||||
$pages = array();
|
||||
$pages = [];
|
||||
if ($myPage['text']) $pages[$view] = $myPage;
|
||||
if ($myPage['Type']=='xmenu') $pages = array_merge($pages, find_pages($view));
|
||||
if (isset($myPage['Tabs'])) $display['tabs'] = strtolower($myPage['Tabs'])=='true' ? 0 : 1;
|
||||
@@ -308,16 +369,16 @@ foreach ($pages as $page) {
|
||||
echo '<div id="footer"><span id="statusraid"><span id="statusbar">';
|
||||
switch ($var['fsState']) {
|
||||
case 'Stopped':
|
||||
echo '<span class="red"><strong>Array Stopped</strong></span>'; break;
|
||||
echo '<span class="red strong">Array Stopped</span>'; break;
|
||||
case 'Starting':
|
||||
echo '<span class="orange"><strong>Array Starting</strong></span>'; break;
|
||||
echo '<span class="orange strong">Array Starting</span>'; break;
|
||||
default:
|
||||
echo '<span class="green"><strong>Array Started</strong></span>'; break;
|
||||
echo '<span class="green strong">Array Started</span>'; break;
|
||||
}
|
||||
echo "</span>• <span class='bitstream'>Dynamix webGui v";
|
||||
echo exec("/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin version /var/log/plugins/dynamix.plg");
|
||||
echo exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin version /var/log/plugins/dynamix.plg");
|
||||
echo "</span></span><span id='countdown'></span><span id='user-notice' class='red-text'></span>";
|
||||
echo "<span id='copyright'>unRAID<i class='fa fa-registered'></i> webGui <i class='fa fa-copyright'></i> 2016, Lime Technology, Inc.";
|
||||
echo "<span id='copyright'>unRAID® webGui ©2016, Lime Technology, Inc.";
|
||||
if (isset($myPage['Author'])) {
|
||||
echo " | Page author: {$myPage['Author']}";
|
||||
if (isset($myPage['Version'])) echo ", version: {$myPage['Version']}";
|
||||
@@ -328,7 +389,7 @@ echo "</span></div>";
|
||||
<script>
|
||||
$(function() {
|
||||
<?if ($notify['entity'] & 1 == 1):?>
|
||||
$.post('/webGui/include/Notify.php',{cmd:'init'},function(x){timers.notifier = setTimeout(notifier,0);});
|
||||
$.post('/webGui/include/Notify.php',{cmd:'init'},function(){timers.notifier = setTimeout(notifier,0);});
|
||||
<?endif;?>
|
||||
$('input[value="Apply"],input[name="cmdEditShare"],input[name="cmdUserEdit"]').attr('disabled','disabled');
|
||||
$('form').find('select,input[type=text],input[type=number],input[type=password],input[type=checkbox],input[type=file],textarea').each(function(){$(this).on('input change',function() {
|
||||
@@ -345,11 +406,39 @@ $(function() {
|
||||
<?else:?>
|
||||
<?if ($version = plugin_update_available('unRAIDServer',true)):?>
|
||||
showNotice('unRAID OS v<?=$version?> is available. <a>Download Now</a>','unRAIDServer');
|
||||
<?elseif (preg_match("/^\*\*REBOOT REQUIRED\!\*\*/", @file_get_contents('/usr/local/emhttp/plugins/unRAIDServer/README.md'))):?>
|
||||
<?elseif (preg_match("/^\*\*REBOOT REQUIRED\!\*\*/", @file_get_contents("$docroot/plugins/unRAIDServer/README.md"))):?>
|
||||
showNotice('Reboot required to apply unRAID OS update');
|
||||
<?elseif ($version = plugin_update_available('dynamix')):?>
|
||||
showNotice('Dynamix webGUI v<?=$version?> is available. <a>Download Now</a>','dynamix');
|
||||
<?endif;?>
|
||||
<?endif;?>
|
||||
<?if ($notify['display']):?>
|
||||
var opts = [{header:'Alerts', image:'/webGui/icons/alerts.png'}];
|
||||
context.init({preventDoubleContext:false});
|
||||
opts.push({text:'View',icon:'fa-folder-open-o',action:function(e){e.preventDefault();openNotifier('alert');}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'History',icon:'fa-file-text-o',action:function(e){e.preventDefault();viewHistory('alert');}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'Acknowledge',icon:'fa-check-box-o',action:function(e){e.preventDefault();closeNotifier('alert');}});
|
||||
context.attach('#nav-tub1',opts);
|
||||
|
||||
var opts = [{header:'Warnings', image:'/webGui/icons/warnings.png'}];
|
||||
context.init({preventDoubleContext:false});
|
||||
opts.push({text:'View',icon:'fa-folder-open-o',action:function(e){e.preventDefault();openNotifier('warning');}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'History',icon:'fa-file-text-o',action:function(e){e.preventDefault();viewHistory('warning');}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'Acknowledge',icon:'fa-check-box-o',action:function(e){e.preventDefault();closeNotifier('warning');}});
|
||||
context.attach('#nav-tub2',opts);
|
||||
|
||||
var opts = [{header:'Messages', image:'/webGui/icons/messages.png'}];
|
||||
context.init({preventDoubleContext:false});
|
||||
opts.push({text:'View',icon:'fa-folder-open-o',action:function(e){e.preventDefault();openNotifier('normal');}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'History',icon:'fa-file-text-o',action:function(e){e.preventDefault();viewHistory('normal');}});
|
||||
opts.push({divider:true});
|
||||
opts.push({text:'Acknowledge',icon:'fa-check-box-o',action:function(e){e.preventDefault();closeNotifier('normal');}});
|
||||
context.attach('#nav-tub3',opts);
|
||||
<?endif;?>
|
||||
if (location.pathname.search(/\/(AddVM|UpdateVM|AddContainer|UpdateContainer)/)==-1) {
|
||||
$('blockquote.inline_help').each(function(i) {
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Wrappers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
|
||||
$dynamix = parse_plugin_cfg('dynamix',true);
|
||||
if (strpos($_POST['log'],'*')===false) @unlink("{$dynamix['notify']['path']}/archive/{$_POST['log']}"); else array_map('unlink',glob("{$dynamix['notify']['path']}/archive/{$_POST['log']}",GLOB_NOSORT));
|
||||
|
||||
@@ -11,16 +11,19 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Helpers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
|
||||
$path = $_POST['path'];
|
||||
$var = parse_ini_file('state/var.ini');
|
||||
$devs = parse_ini_file('state/devs.ini',true);
|
||||
$disks = parse_ini_file('state/disks.ini',true);
|
||||
$sum = ['count'=>0, 'temp'=>0, 'fsSize'=>0, 'fsUsed'=>0, 'fsFree'=>0, 'numReads'=>0, 'numWrites'=>0, 'numErrors'=>0];
|
||||
$new = '/var/tmp/diskio';
|
||||
$old = '/var/tmp/lastio';
|
||||
extract(parse_plugin_cfg('dynamix',true));
|
||||
|
||||
require_once 'CustomMerge.php';
|
||||
require_once "$docroot/webGui/include/CustomMerge.php";
|
||||
|
||||
function in_parity_log($log,$timestamp) {
|
||||
if (file_exists($log)) {
|
||||
@@ -77,7 +80,7 @@ function assignment(&$disk) {
|
||||
$out .= "<select class=\"slot\" name=\"slotId.{$disk['idx']}\" onChange=\"{$disk['name']}Form.submit()\">";
|
||||
$empty = ($disk['idSb']!='' ? 'no device' : 'unassigned');
|
||||
if ($disk['id']!='') {
|
||||
$out .= "<option value=\"{$disk['id']}\" selected>".device_desc($disk)."</option>";
|
||||
$out .= "<option value=\"{$disk['id']}\" selected>".device_desc($disk)."</option>";
|
||||
$out .= "<option value=''>$empty</option>";
|
||||
} else
|
||||
$out .= "<option value='' selected>$empty</option>";
|
||||
@@ -108,6 +111,30 @@ function fs_info(&$disk) {
|
||||
echo "<td colspan='2'></td><td>{$disk['fsStatus']}</td><td></td>";
|
||||
echo "<td>".device_browse($disk)."</td>";
|
||||
}
|
||||
function disk_map(&$rows) {
|
||||
$map = [];
|
||||
foreach ($rows as $row) {
|
||||
$key = explode(' ',$row);
|
||||
$map[$key[0]] = $key[3].' '.$key[7];
|
||||
}
|
||||
$rows = $map;
|
||||
}
|
||||
function sectors(&$data,$i) {
|
||||
return $data ? explode(' ',$data)[$i] : 0;
|
||||
}
|
||||
function my_diskio($id,$i) {
|
||||
global $diskio, $lastio, $disks;
|
||||
if (empty($diskio) || empty($lastio)) return my_scale(0,$unit,1)." $unit/s";
|
||||
$time = max($diskio['time']-$lastio['time'],1);
|
||||
if ($id=='A' || $id=='P') {
|
||||
$type = $id=='A' ? '/Parity|Data/' : '/Cache/';
|
||||
$disksum = 0;
|
||||
foreach ($disks as $disk) if (preg_match($type,$disk['type'])) $disksum += sectors($diskio[$disk['device']],$i)-sectors($lastio[$disk['device']],$i);
|
||||
return my_scale($disksum*512/$time,$unit,1)." $unit/s";
|
||||
} else {
|
||||
return my_scale((sectors($diskio[$id],$i)-sectors($lastio[$id],$i))*512/$time,$unit,1)." $unit/s";
|
||||
}
|
||||
}
|
||||
function array_offline(&$disk,$w) {
|
||||
$warning = $w ? '<span class="red-text"><em>ALL DATA ON THIS DISK WILL BE ERASED WHEN ARRAY IS STARTED</em></span>' : '';
|
||||
echo "<tr>";
|
||||
@@ -179,8 +206,8 @@ function array_online(&$disk) {
|
||||
echo "<td>".device_info($disk)."</td>";
|
||||
echo "<td>".device_desc($disk)."</td>";
|
||||
echo "<td>".my_temp($disk['temp'])."</td>";
|
||||
echo "<td>".my_number($disk['numReads'])."</td>";
|
||||
echo "<td>".my_number($disk['numWrites'])."</td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($disk['device'],0)."</span><span class='number'>".my_number($disk['numReads'])."</span></td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($disk['device'],1)."</span><span class='number'>".my_number($disk['numWrites'])."</span></td>";
|
||||
echo "<td>".my_number($disk['numErrors'])."</td>";
|
||||
fs_info($disk);
|
||||
break;
|
||||
@@ -203,7 +230,7 @@ function read_disk(&$device, $item) {
|
||||
$smart = "/var/local/emhttp/smart/$device";
|
||||
if (!file_exists($smart) || (time()-filemtime($smart)>=$var['poll_attributes'])) exec("smartctl -n standby -A /dev/$device >$smart &");
|
||||
$temp = exec("awk '\$1==190||\$1==194{print \$10;exit}' $smart");
|
||||
return $temp ? $temp : '*';
|
||||
return $temp ?: '*';
|
||||
}
|
||||
}
|
||||
function show_totals($text) {
|
||||
@@ -212,8 +239,8 @@ function show_totals($text) {
|
||||
echo "<td><img src='/webGui/images/sum.png' class='icon'>Total</td>";
|
||||
echo "<td>$text</td>";
|
||||
echo "<td>".($sum['count']>0 ? my_temp(round($sum['temp']/$sum['count'],1)) : '*')."</td>";
|
||||
echo "<td>".my_number($sum['numReads'])."</td>";
|
||||
echo "<td>".my_number($sum['numWrites'])."</td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($text[0],0)."</span><span class='number'>".my_number($sum['numReads'])."</span></td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($text[0],1)."</span><span class='number'>".my_number($sum['numWrites'])."</span></td>";
|
||||
echo "<td>".my_number($sum['numErrors'])."</td>";
|
||||
echo "<td></td>";
|
||||
if (strstr($text,'Array') && ($var['startMode']=='Normal')) {
|
||||
@@ -264,6 +291,21 @@ function cache_slots() {
|
||||
$out .= "</select></form>";
|
||||
return $out;
|
||||
}
|
||||
$time = time();
|
||||
$last = @parse_ini_file($new);
|
||||
if ($_POST['diskio'] && $time-$last['time']>8) {
|
||||
@copy($new, $old);
|
||||
$lastio = $last;
|
||||
exec("grep -o '\(sd[a-z]*\|nvme[0-9]n1\) .*' /proc/diskstats",$diskio);
|
||||
disk_map($diskio);
|
||||
$diskio['time'] = $time;
|
||||
$keys = [];
|
||||
foreach ($diskio as $key => $data) $keys[] = "$key=$data";
|
||||
file_put_contents($new, implode("\n",$keys));
|
||||
} else {
|
||||
$lastio = @parse_ini_file($old);
|
||||
$diskio = $last;
|
||||
}
|
||||
switch ($_POST['device']) {
|
||||
case 'array':
|
||||
if ($var['fsState']=='Stopped') {
|
||||
@@ -284,8 +326,8 @@ case 'flash':
|
||||
echo "<td>".device_info($disk)."</td>";
|
||||
echo "<td>".device_desc($disk)."</td>";
|
||||
echo "<td>*</td>";
|
||||
echo "<td>".my_number($disk['numReads'])."</td>";
|
||||
echo "<td>".my_number($disk['numWrites'])."</td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($disk['device'],0)."</span><span class='number'>".my_number($disk['numReads'])."</span></td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($disk['device'],1)."</span><span class='number'>".my_number($disk['numWrites'])."</span></td>";
|
||||
echo "<td>".my_number($disk['numErrors'])."</td>";
|
||||
fs_info($disk);
|
||||
echo "</tr>";
|
||||
@@ -309,22 +351,24 @@ case 'open':
|
||||
echo "<td>".device_info($dev)."</td>";
|
||||
echo "<td>".device_desc($dev)."</td>";
|
||||
echo "<td>".my_temp($dev['temp'])."</td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($dev['device'],0)."</span><span class='number'>-</span></td>";
|
||||
echo "<td><span class='diskio'>".my_diskio($dev['device'],1)."</span><span class='number'>-</span></td>";
|
||||
if (file_exists("/tmp/preclear_stat_{$dev['device']}")) {
|
||||
$text = exec("cut -d'|' -f3 /tmp/preclear_stat_{$dev['device']}|sed 's:\^n:\<br\>:g'");
|
||||
if (strpos($text,'Total time')===false) $text = 'Preclear in progress... '.$text;
|
||||
echo "<td colspan='8' style='text-align:right'><em>$text</em></td>";
|
||||
echo "<td colspan='6' style='text-align:right'><em>$text</em></td>";
|
||||
} else
|
||||
echo "<td colspan='8'></td>";
|
||||
echo "<td colspan='6'></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
break;
|
||||
case 'parity':
|
||||
$data = array();
|
||||
$data = [];
|
||||
if ($var['mdResync']>0) {
|
||||
$data[] = my_scale($var['mdResync']*1024,$unit)." $unit";
|
||||
$data[] = my_clock(floor(($var['currTime']-$var['sbUpdated'])/60));
|
||||
$data[] = my_scale($var['mdResyncPos']*1024,$unit)." $unit (".number_format(($var['mdResyncPos']/($var['mdResync']/100+1)),1,substr($display['number'],0,1),'')." %)";
|
||||
$data[] = my_scale($var['mdResyncDb']/$var['mdResyncDt']*1024,$unit, 1)." $unit/sec";
|
||||
$data[] = my_scale($var['mdResyncDb']*1024/$var['mdResyncDt'],$unit, 1)." $unit/sec";
|
||||
$data[] = my_clock(round(((($var['mdResyncDt']*(($var['mdResync']-$var['mdResyncPos'])/($var['mdResyncDb']/100+1)))/100)/60),0));
|
||||
$data[] = $var['sbSyncErrs'];
|
||||
echo implode(';',$data);
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Helpers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
|
||||
$shares = parse_ini_file('state/shares.ini',true);
|
||||
$disks = parse_ini_file('state/disks.ini',true);
|
||||
@@ -53,7 +54,7 @@ $myDisks = array_filter(array_diff(array_keys($disks), explode(',',$var['shareUs
|
||||
|
||||
// Share size per disk
|
||||
$preserve = ($path==$prev || $compute=='yes');
|
||||
$ssz2 = array();
|
||||
$ssz2 = [];
|
||||
foreach (glob("state/*.ssz2", GLOB_NOSORT) as $entry) {
|
||||
if ($preserve) {
|
||||
$ssz2[basename($entry, ".ssz2")] = parse_ini_file($entry);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $_SERVER['DOCUMENT_ROOT'];
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
$file = $_POST['file'];
|
||||
switch ($_POST['cmd']) {
|
||||
case 'save':
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
$var = parse_ini_file('state/var.ini');
|
||||
$unraid = parse_ini_file('/etc/unraid-version');
|
||||
$keyfile = trim(base64_encode(@file_get_contents($var['regFILE'])));
|
||||
@@ -17,7 +18,7 @@ $keyfile = trim(base64_encode(@file_get_contents($var['regFILE'])));
|
||||
if (array_key_exists('getdiagnostics', $_GET)) {
|
||||
$anonymize = empty($_GET['anonymize']) ? '-a' : '';
|
||||
$diag_file = '/tmp/feedback_diagnostics_'.time().'.zip';
|
||||
exec("/usr/local/emhttp/plugins/dynamix/scripts/diagnostics $anonymize $diag_file");
|
||||
exec("$docroot/plugins/dynamix/scripts/diagnostics $anonymize $diag_file");
|
||||
echo base64_encode(@file_get_contents($diag_file));
|
||||
@unlink($diag_file);
|
||||
exit;
|
||||
@@ -138,7 +139,7 @@ function form_submit(url, params, $panel, diagnostics) {
|
||||
data.message = data.message || '';
|
||||
|
||||
var url_parts = url.split('/');
|
||||
var success_message = '<center><h2>Thank You!</h2><img src="/webGui/images/feedback_'+url_parts[4]+'.jpg"/><p style="text-align:center">'+data.message+'</p></center>';
|
||||
var success_message = '<div style="text-align:center"><h2>Thank You!</h2><img src="/webGui/images/feedback_'+url_parts[4]+'.jpg"/><p style="text-align:center">'+data.message+'</p></div>';
|
||||
|
||||
$('#thanks_panel').html(success_message).fadeIn('fast', function() {
|
||||
var resetfunction = window[url_parts[4]+'_reset'];
|
||||
|
||||
@@ -11,14 +11,15 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Wrappers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
|
||||
// Helper functions
|
||||
function my_scale($value, &$unit, $decimals = NULL) {
|
||||
global $display;
|
||||
$scale = $display['scale'];
|
||||
$number = $display['number'];
|
||||
$units = array('B','KB','MB','GB','TB','PB');
|
||||
$units = ['B','KB','MB','GB','TB','PB'];
|
||||
if ($scale==0 && $decimals===NULL) {
|
||||
$decimals = 0;
|
||||
$unit = '';
|
||||
@@ -61,7 +62,7 @@ function my_id($id) {
|
||||
return ($display['wwn'] || substr($wwn,0,2)!='_3' || preg_match('/.[_-]/',$wwn)) ? $id : substr($id,0,$len-18);
|
||||
}
|
||||
function my_word($num) {
|
||||
$words = array('zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty');
|
||||
$words = ['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty','twenty-one','twenty-two','twenty-three','twenty-four','twenty-five','twenty-six','twenty-seven','twenty-eight','twenty-nine','thirty'];
|
||||
return $num<count($words) ? $words[$num] : $num;
|
||||
}
|
||||
function my_usage() {
|
||||
@@ -78,7 +79,7 @@ function my_usage() {
|
||||
$used = $arraysize ? 100-round(100*$arrayfree/$arraysize) : 0;
|
||||
echo "<div class='usage-bar'><span style='width:{$used}%' class='".usage_color($display,$used,false)."'><span>{$used}%</span></span></div>";
|
||||
} else {
|
||||
echo "<div class='usage-bar'><span><center>".($var['fsState']=='Started'?'Maintenance':'off-line')."</center></span></div>";
|
||||
echo "<div class='usage-bar'><span style='text-align:center'>".($var['fsState']=='Started'?'Maintenance':'off-line')."</span></div>";
|
||||
}
|
||||
}
|
||||
function usage_color(&$disk,$limit,$free) {
|
||||
@@ -226,8 +227,9 @@ function is_block($path) {
|
||||
}
|
||||
function autov($file) {
|
||||
global $docroot;
|
||||
clearstatcache(true, $docroot.$file);
|
||||
echo "$file?v=".filemtime($docroot.$file);
|
||||
$path = $docroot.$file;
|
||||
clearstatcache(true, $path);
|
||||
echo "$file?v=".filemtime($path);
|
||||
}
|
||||
function transpose_user_path($path) {
|
||||
if (strpos($path, '/mnt/user/') === 0 && file_exists($path)) {
|
||||
@@ -237,4 +239,11 @@ function transpose_user_path($path) {
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
// custom parse_ini_file/string functions to deal with '#' comment lines
|
||||
function my_parse_ini_file($file, $sections=false, $scanner=INI_SCANNER_NORMAL) {
|
||||
return parse_ini_string(preg_replace('/^#/',';',file_get_contents($file)),$sections,$scanner);
|
||||
}
|
||||
function my_parse_ini_string($text, $sections=false, $scanner=INI_SCANNER_NORMAL) {
|
||||
return parse_ini_string(preg_replace('/^#/',';',$text),$sections,$scanner);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
function addLog($line) { echo "<script>addLog('$line');</script>"; }
|
||||
|
||||
readfile("/usr/local/emhttp/logging.htm");
|
||||
readfile("$docroot/logging.htm");
|
||||
$var = parse_ini_file('state/var.ini');
|
||||
|
||||
$parsed_url = parse_url($_GET['url']);
|
||||
|
||||
@@ -11,15 +11,19 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Wrappers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
|
||||
$dynamix = parse_plugin_cfg('dynamix',true);
|
||||
$filter = $_GET['filter'];
|
||||
$files = glob("{$dynamix['notify']['path']}/archive/*.notify", GLOB_NOSORT);
|
||||
usort($files, create_function('$a,$b', 'return filemtime($b)-filemtime($a);'));
|
||||
|
||||
$row = 1;
|
||||
$row = 1; $empty = true;
|
||||
foreach ($files as $file) {
|
||||
$fields = explode(PHP_EOL, file_get_contents($file));
|
||||
if ($filter && $filter != substr($fields[4],11)) continue;
|
||||
$empty = false;
|
||||
$archive = basename($file);
|
||||
if ($extra = count($fields)>6) {
|
||||
$td_ = "<td rowspan='3'><a href='#' onclick='openClose($row)'>"; $_td = "</a></td>";
|
||||
@@ -29,7 +33,7 @@ foreach ($files as $file) {
|
||||
$c = 0;
|
||||
foreach ($fields as $field) {
|
||||
if ($c==5) break;
|
||||
$item = $field ? explode('=', $field, 2) : array("","-");
|
||||
$item = $field ? explode('=', $field, 2) : ["","-"];
|
||||
echo (!$c++) ? "<tr>$td_".date("{$dynamix['notify']['date']} {$dynamix['notify']['time']}", $item[1])."$_td" : "<td>{$item[1]}</td>";
|
||||
}
|
||||
echo "<td style='text-align:right'><a href='#' onclick='$.post(\"/webGui/include/DeleteLogFile.php\",{log:\"$archive\"},function(){archiveList();});return false' title='Delete notification'><i class='fa fa-trash-o'></i></a></td></tr>";
|
||||
@@ -39,5 +43,5 @@ foreach ($files as $file) {
|
||||
$row++;
|
||||
}
|
||||
}
|
||||
if (empty($files)) echo "<tr><td colspan='6' style='text-align:center'><em>No notifications available</em></td></tr>";
|
||||
if ($empty) echo "<tr><td colspan='6' style='text-align:center;padding-top:12px'><em>No notifications present</em></td></tr>";
|
||||
?>
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$notify = "/usr/local/emhttp/webGui/scripts/notify";
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
$notify = "$docroot/webGui/scripts/notify";
|
||||
|
||||
switch ($_POST['cmd']) {
|
||||
case 'init':
|
||||
shell_exec("$notify init");
|
||||
@@ -45,7 +47,7 @@ case 'get':
|
||||
echo shell_exec("$notify get");
|
||||
break;
|
||||
case 'archive':
|
||||
shell_exec("$notify archive '{$_POST['file']}'");
|
||||
shell_exec("$notify archive \"{$_POST['file']}\"");
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Markdown.php';
|
||||
require_once "$docroot/webGui/include/Markdown.php";
|
||||
|
||||
function get_ini_key($key,$default) {
|
||||
$x = strpos($key, '[');
|
||||
@@ -42,7 +42,7 @@ function build_pages($pattern) {
|
||||
|
||||
function find_pages($item) {
|
||||
global $site,$var,$disks,$devs,$users,$shares,$sec,$sec_nfs,$sec_afp,$name,$display;
|
||||
$pages = array();
|
||||
$pages = [];
|
||||
foreach ($site as $page) {
|
||||
if (empty($page['Menu'])) continue;
|
||||
$menu = strtok($page['Menu'], ' ');
|
||||
|
||||
@@ -49,9 +49,9 @@ if (file_exists($log)) {
|
||||
if ($list)
|
||||
for ($i=count($list); $i>=0; --$i) echo $list[$i];
|
||||
else
|
||||
echo "<tr><td colspan='4' style='text-align:center'>No parity check history present!</td></tr>";
|
||||
echo "<tr><td colspan='4' style='text-align:center;padding-top:12px'>No parity check history present!</td></tr>";
|
||||
?>
|
||||
</tbody></table>
|
||||
<center><input type="button" value="Done" onclick="top.Shadowbox.close()"></center>
|
||||
<div style="text-align:center"><input type="button" value="Done" onclick="top.Shadowbox.close()"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
function PsExecute($command, $timeout = 20, $sleep = 2) {
|
||||
exec($command.'>/dev/null & echo $!',$op);
|
||||
$pid = (int)$op[0];
|
||||
@@ -31,7 +33,7 @@ function PsEnded($pid) {
|
||||
function PsKill($pid) {
|
||||
exec("kill -9 $pid");
|
||||
}
|
||||
if (PsExecute("/usr/local/emhttp/webGui/scripts/notify -s 'unRAID SMTP Test' -d 'Test message received!' -i 'alert' -t")) {
|
||||
if (PsExecute("$docroot/webGui/scripts/notify -s 'unRAID SMTP Test' -d 'Test message received!' -i 'alert' -t")) {
|
||||
$result = exec("tail -3 /var/log/syslog|awk '/sSMTP/ {getline;print}'|cut -d']' -f2|cut -d'(' -f1");
|
||||
$color = strpos($result, 'Sent mail') ? 'green' : 'red';
|
||||
echo "Test result<span class='$color'>$result</span>";
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once 'Helpers.php';
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
|
||||
$shares = parse_ini_file('state/shares.ini',true);
|
||||
$disks = parse_ini_file('state/disks.ini',true);
|
||||
@@ -28,7 +29,7 @@ $display['scale'] = $_GET['scale'];
|
||||
$display['number'] = $_GET['number'];
|
||||
|
||||
if (!$shares) {
|
||||
echo "<tr><td colspan='8' style='text-align:center'><i class='fa fa-folder-open-o icon'></i>There are no exportable user shares</td></tr>";
|
||||
echo "<tr><td colspan='8' style='text-align:center;padding-top:12px'><i class='fa fa-folder-open-o icon'></i>There are no exportable user shares</td></tr>";
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -58,7 +59,7 @@ $myDisks = array_filter(array_diff(array_keys($disks), explode(',',$var['shareUs
|
||||
|
||||
// Share size per disk
|
||||
$preserve = ($path==$prev || $compute=='yes');
|
||||
$ssz1 = array();
|
||||
$ssz1 = [];
|
||||
foreach (glob("state/*.ssz1", GLOB_NOSORT) as $entry) {
|
||||
if ($preserve)
|
||||
$ssz1[basename($entry, ".ssz1")] = parse_ini_file($entry);
|
||||
@@ -110,5 +111,5 @@ foreach ($shares as $name => $share) {
|
||||
}
|
||||
}
|
||||
if ($row==0) {
|
||||
echo "<tr><td colspan='8' style='text-align:center'><i class='fa fa-folder-open-o icon'></i>There are no exportable user shares</td></tr>";
|
||||
echo "<tr><td colspan='8' style='text-align:center;padding-top:12px'><i class='fa fa-folder-open-o icon'></i>There are no exportable user shares</td></tr>";
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$docroot = $docroot ?: @$_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
|
||||
|
||||
function normalize($text, $glue='_') {
|
||||
$words = explode($glue,$text);
|
||||
foreach ($words as &$word) $word = $word==strtoupper($word) ? $word : preg_replace(['/^(ct|cnt)$/','/^blk$/'],['count','block'],strtolower($word));
|
||||
@@ -30,7 +32,7 @@ function spindownDelay($port) {
|
||||
}
|
||||
}
|
||||
$disks = []; $var = [];
|
||||
require_once 'CustomMerge.php';
|
||||
require_once "$docroot/webGui/include/CustomMerge.php";
|
||||
$name = isset($_POST['name']) ? $_POST['name'] : '';
|
||||
$port = isset($_POST['port']) ? $_POST['port'] : '';
|
||||
if ($name) {
|
||||
@@ -50,8 +52,8 @@ if ($name) {
|
||||
}
|
||||
switch ($_POST['cmd']) {
|
||||
case "attributes":
|
||||
require_once 'Wrappers.php';
|
||||
require_once 'Preselect.php';
|
||||
require_once "$docroot/webGui/include/Wrappers.php";
|
||||
require_once "$docroot/webGui/include/Preselect.php";
|
||||
$select = isset($disk['smSelect']) ? $disk['smSelect'] : -1; if ($select==-1) $select = isset($var['smSelect']) ? $var['smSelect'] : 0;
|
||||
$level = isset($disk['smLevel']) ? $disk['smLevel'] : -1; if ($level==-1) $level = isset($var['smLevel']) ? $var['smLevel'] : 1;
|
||||
$events = isset($disk['smEvents']) ? explode('|',$disk['smEvents']) : (isset($var['smEvents']) ? explode('|',$var['smEvents']) : $numbers);
|
||||
@@ -75,7 +77,7 @@ case "attributes":
|
||||
echo "<tr{$color}>".implode('',array_map('normalize', $info))."</tr>";
|
||||
$empty = false;
|
||||
}
|
||||
if ($empty) echo "<tr><td colspan='10' style='text-align:center'>Can not read attributes</td></tr>";
|
||||
if ($empty) echo "<tr><td colspan='10' style='text-align:center;padding-top:12px'>Can not read attributes</td></tr>";
|
||||
break;
|
||||
case "capabilities":
|
||||
exec("smartctl -c $type /dev/$port|awk 'NR>5'",$output);
|
||||
@@ -94,7 +96,7 @@ case "capabilities":
|
||||
$empty = false;
|
||||
}
|
||||
}
|
||||
if ($empty) echo "<tr><td colspan='3' style='text-align:center'>Can not read capabilities</td></tr>";
|
||||
if ($empty) echo "<tr><td colspan='3' style='text-align:center;padding-top:12px'>Can not read capabilities</td></tr>";
|
||||
break;
|
||||
case "identify":
|
||||
$passed = ['PASSED','OK'];
|
||||
@@ -111,7 +113,7 @@ case "identify":
|
||||
echo "<tr>".normalize(preg_replace('/ is:$/',':',"$title:"),' ')."<td>$info</td></tr>";
|
||||
$empty = false;
|
||||
}
|
||||
if ($empty) echo "<tr><td colspan='2' style='text-align:center'>Can not read identification</td></tr>";
|
||||
if ($empty) echo "<tr><td colspan='2' style='text-align:center;padding-top:12px'>Can not read identification</td></tr>";
|
||||
break;
|
||||
case "save":
|
||||
exec("smartctl -a $type /dev/$port >{$_SERVER['DOCUMENT_ROOT']}/{$_POST['file']}");
|
||||
@@ -133,28 +135,28 @@ case "stop":
|
||||
case "update":
|
||||
if (!exec("hdparm -C /dev/$port|grep -Pom1 'active|unknown'")) {
|
||||
$cmd = $_POST['type']=='New' ? "cmd=/webGui/scripts/hd_parm&arg1=up&arg2=$name" : "cmdSpinup=$name";
|
||||
echo "<a href='/update.htm?$cmd' class='info' target='progressFrame'><input type='button' value='Spin Up'></a><span class='orange-text'><big>Unavailable - disk must be spun up</big></span>";
|
||||
echo "<a href='/update.htm?$cmd' class='info' target='progressFrame'><input type='button' value='Spin Up'></a><span class='orange-text'><span class='big'>Unavailable - disk must be spun up</span></span>";
|
||||
break;
|
||||
}
|
||||
$progress = exec("smartctl -c $type /dev/$port|grep -Pom1 '\d+%'");
|
||||
if ($progress) {
|
||||
echo "<big><i class='fa fa-spinner fa-pulse'></i> self-test in progress, ".(100-substr($progress,0,-1))."% complete</big>";
|
||||
echo "<span class='big'><i class='fa fa-spinner fa-pulse'></i> self-test in progress, ".(100-substr($progress,0,-1))."% complete</span>";
|
||||
break;
|
||||
}
|
||||
$result = trim(exec("smartctl -l selftest $type /dev/$port|grep -m1 '^# 1'|cut -c26-55"));
|
||||
if (!$result) {
|
||||
echo "<big>No self-tests logged on this disk</big>";
|
||||
echo "<span class='big'>No self-tests logged on this disk</span>";
|
||||
break;
|
||||
}
|
||||
if (strpos($result, "Completed without error")!==false) {
|
||||
echo "<span class='green-text'><big>$result</big></span>";
|
||||
echo "<span class='green-text'><span class='big'>$result</span></span>";
|
||||
break;
|
||||
}
|
||||
if (strpos($result, "Aborted")!==false or strpos($result, "Interrupted")!==false) {
|
||||
echo "<span class='orange-text'><big>$result</big></span>";
|
||||
echo "<span class='orange-text'><span class='big'>$result</span></span>";
|
||||
break;
|
||||
}
|
||||
echo "<span class='red-text'><big>Errors occurred - Check SMART report</big></span>";
|
||||
echo "<span class='red-text'><span class='big'>Errors occurred - Check SMART report</span></span>";
|
||||
break;
|
||||
case "selftest":
|
||||
echo shell_exec("smartctl -l selftest $type /dev/$port|awk 'NR>5'");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user