mirror of
https://github.com/unraid/webgui.git
synced 2026-01-23 09:59:59 -06:00
Merge pull request #219 from bergware/6.4-wip
Small visual enhancement in array status (footer)
This commit is contained in:
@@ -390,13 +390,13 @@ echo '<div id="footer"><span id="statusraid"><span id="statusbar">';
|
||||
$progress = ($var['fsProgress']!='')? "•<span class='blue strong'>{$var['fsProgress']}</span>" : '';
|
||||
switch ($var['fsState']) {
|
||||
case 'Stopped':
|
||||
echo "<span class='red strong'>Array Stopped</span>$progress"; break;
|
||||
echo "<span class='red strong'><i class='fa fa-battery-empty'></i> Array Stopped</span>$progress"; break;
|
||||
case 'Starting':
|
||||
echo "<span class='orange strong'>Array Starting</span>$progress"; break;
|
||||
echo "<span class='orange strong'><i class='fa fa-battery-half'></i> Array Starting</span>$progress"; break;
|
||||
case 'Stopping':
|
||||
echo "<span class='orange strong'>Array Stopping</span>$progress"; break;
|
||||
echo "<span class='orange strong'><i class='fa fa-battery-half'></i> Array Stopping</span>$progress"; break;
|
||||
default:
|
||||
echo "<span class='green strong'>Array Started</span>$progress"; break;
|
||||
echo "<span class='green strong'><i class='fa fa-battery-full'></i> Array Started</span>$progress"; break;
|
||||
}
|
||||
echo "</span></span><span id='countdown'></span><span id='user-notice' class='red-text'></span>";
|
||||
echo "<span id='copyright'>unRAID® webGui ©2017, Lime Technology, Inc.";
|
||||
@@ -443,13 +443,13 @@ watchdog.on('message', function(data) {
|
||||
var progress = ini['fsProgress'];
|
||||
var status;
|
||||
if (state=='Stopped') {
|
||||
status = "<span class='red strong'>Array Stopped</span>";
|
||||
status = "<span class='red strong'><i class='fa fa-battery-empty'></i> Array Stopped</span>";
|
||||
} else if (state=='Started') {
|
||||
status = "<span class='green strong'>Array Started</span>";
|
||||
status = "<span class='green strong'><i class='fa fa-battery-full'></i> Array Started</span>";
|
||||
} else if (state=='Formatting') {
|
||||
status = "<span class='green strong'>Array Started</span>•<span class='orange strong'>Formatting device(s)</span>";
|
||||
status = "<span class='green strong'><i class='fa fa-battery-full'></i> Array Started</span>•<span class='orange strong'>Formatting device(s)</span>";
|
||||
} else {
|
||||
status = "<span class='orange strong'>Array "+state+"</span>";
|
||||
status = "<span class='orange strong'><i class='fa fa-battery-half'></i> Array "+state+"</span>";
|
||||
}
|
||||
if (ini['mdResync']>0) {
|
||||
var action;
|
||||
|
||||
@@ -125,7 +125,7 @@ function vfs_luks($fs) {
|
||||
function fs_info(&$disk) {
|
||||
global $display;
|
||||
if ($disk['fsStatus']=='-') {
|
||||
echo $disk['type']=='Cache' ? "<td colspan='4'>Device is part of cache pool</td><td></td>" : "<td colspan='5'></td>";
|
||||
echo ($disk['type']=='Cache' && $disk['name']!='cache') ? "<td colspan='4'>Device is part of cache pool</td><td></td>" : "<td colspan='5'></td>";
|
||||
return;
|
||||
} elseif ($disk['fsStatus']=='Mounted') {
|
||||
echo "<td>".vfs_type($disk['fsType'])."</td>";
|
||||
|
||||
@@ -14,24 +14,24 @@
|
||||
$task = $_POST['task'];
|
||||
switch ($task) {
|
||||
case 'delete':
|
||||
$gateway =str_replace(' ','-', trim($_POST['gateway']));
|
||||
$gateway = str_replace(' ','-',trim($_POST['gateway']));
|
||||
$route = trim($_POST['route']);
|
||||
if ($gateway && $route) exec("/etc/rc.d/rc.inet1 ".escapeshellarg("{$gateway}_{$route}_del"));
|
||||
break;
|
||||
case 'Add Route':
|
||||
$gateway =str_replace(' ','-', trim($_POST['gateway']));
|
||||
$gateway = str_replace(' ','-',trim($_POST['gateway']));
|
||||
$route = trim($_POST['route']);
|
||||
$metric = strlen($_POST['metric']) ? trim($_POST['metric']) : 1;
|
||||
if ($gateway && $route) exec("/etc/rc.d/rc.inet1 ".escapeshellarg("{$gateway}_{$route}_{$metric}_add"));
|
||||
break;
|
||||
default:
|
||||
exec("ip -4 route show|grep -v '^127.0.0.0'",$ipv4);
|
||||
exec("ip -6 route show|grep -Pv '^(fe80|ff0[0-9])::/'",$ipv6);
|
||||
exec("ip -6 route show|grep -Pv '^(anycast )?(f[ef][0-9][0-9])::'",$ipv6);
|
||||
foreach ($ipv4 as $info) {
|
||||
$cell = explode(' ',$info);
|
||||
$route = $cell[0];
|
||||
$gateway = $cell[2];
|
||||
$button = preg_replace('/[\.:\/]/','',$gateway.$route);
|
||||
$button = 'bt-'.preg_replace('/[\.:\/]/','',$gateway.$route);
|
||||
$metric = '1';
|
||||
for ($i=3; $i<count($cell); $i++) if ($cell[$i] == 'metric') {$metric = $cell[$i+1]; break;}
|
||||
echo "<tr><td>IPv4</td><td>$route</td><td>$gateway</td><td>$metric</td><td style='text-align:center'><a id='$button' href='#' onclick='deleteRoute(\"#$button\",\"$gateway\",\"$route\");return false'><i class='fa fa-trash-o'></i></a></td></tr>";
|
||||
@@ -40,8 +40,8 @@ default:
|
||||
foreach ($ipv6 as $info) {
|
||||
$cell = explode(' ',$info);
|
||||
$route = $cell[0];
|
||||
$gateway = $cell[2];
|
||||
$button = preg_replace('/[\.:\/]/','',$gateway.$route);
|
||||
$gateway = $route=='anycast' ? $cell[3] : $cell[2];
|
||||
$button = 'bt-'.preg_replace('/[\.:\/]/','',$gateway.$route);
|
||||
$metric = '1';
|
||||
for ($i=3; $i<count($cell); $i++) if ($cell[$i] == 'metric') {$metric = $cell[$i+1]; break;}
|
||||
echo "<tr><td>IPv6</td><td>$route</td><td>$gateway</td><td>$metric</td><td style='text-align:center'><a id='$button' href='#' onclick='deleteRoute(\"#$button\",\"$gateway\",\"$route\");return false'><i class='fa fa-trash-o'></i></a></td></tr>";
|
||||
|
||||
@@ -194,7 +194,7 @@ foreach ($devices as $device) {
|
||||
exec("smartctl -a $type ".escapeshellarg("/dev/$port")." 2>/dev/null|todos >".escapeshellarg("/$diag/smart/$name-$date $diskName ($port).txt"));
|
||||
}
|
||||
// create cache pool information
|
||||
if (is_dir('/mnt/cache') && strpos($disks['cache']['fsType'],'btrfs')) {
|
||||
if (is_dir('/mnt/cache') && strpos($disks['cache']['fsType'],'btrfs')!==false) {
|
||||
exec("/sbin/btrfs filesystem usage /mnt/cache 2>/dev/null|todos >".escapeshellarg("/$diag/system/btrfs-usage.txt"));
|
||||
}
|
||||
// create resulting zip file and remove temp folder
|
||||
|
||||
Reference in New Issue
Block a user