merge in changes from unRAID 6.1.8

This commit is contained in:
Eric Schultz
2016-02-09 16:19:04 -08:00
parent fb1c136c3f
commit bb7a9a8080
22 changed files with 299 additions and 237 deletions
+4 -1
View File
@@ -107,7 +107,10 @@ case 'disk':
my_insert($row4[$n],"<img src=$path/$state.png>");
break;}
$temp = $disk['temp'];
if ($temp>=$_POST['hot']) my_insert($row5[$n],"<span class='heat-img'><img src='$path/".($temp>=$_POST['max']?'max':'hot').".png'></span><span class='heat-text' style='display:none'>".my_temp($temp,$_POST['unit'])."</span>");
$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>");
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).'%'):'');
}
+2 -2
View File
@@ -23,14 +23,14 @@ case 'save':
copy($source, $tmp);
exec("zip -qlj $docroot/$file $tmp");
@unlink($tmp);
}
}
echo "/$file";
break;
case 'delete':
@unlink("$docroot/$file");
break;
case 'diag':
exec("$docroot/webGui/scripts/diagnostics $docroot/$file");
exec("$docroot/webGui/scripts/diagnostics {$_POST['anonymize']} $docroot/$file");
echo "/$file";
break;
}
+4 -9
View File
@@ -8,22 +8,17 @@ switch ($cmd) {
case 'load':
if (isset($_POST['filedata'])) {
exec("rm -f $temp/*.png");
$result = file_put_contents("$temp/$file", base64_decode(str_replace(array('data:image/png;base64,',' '),array('','+'),$_POST['filedata'])));
$result = file_put_contents("$temp/$file", base64_decode(str_replace(['data:image/png;base64,',' '],['','+'],$_POST['filedata'])));
}
break;
case 'save':
exec("mkdir -p $path");
if (isset($_POST['flash'])) @copy("$temp/$file", $_POST['flash']);
$result = @rename("$temp/$file", "$path/{$_POST['output']}.png");
$result = @rename("$temp/$file", "$path/{$_POST['output']}");
break;
case 'delete':
@unlink("$path/{$_POST['output']}.png");
exec("rm -f $path/$file");
$result = true;
break;
case 'reset':
if (isset($_POST['flash'])) @unlink($_POST['flash']);
$result = @copy("$path/$file", "$path/{$_POST['output']}.png");
break;
}
echo ($result ? '200 OK' : '500 Internal Error');
echo ($result ? 'OK 200' : 'Internal Error 500');
?>
+4 -4
View File
@@ -82,12 +82,12 @@ function usage_color(&$disk,$limit,$free) {
$critical = !empty($disk['critical']) ? $disk['critical'] : $display['critical'];
$warning = !empty($disk['warning']) ? $disk['warning'] : $display['warning'];
if (!$free) {
if ($limit>=$critical) return 'redbar';
if ($limit>=$warning) return 'orangebar';
if ($limit>=$critical && $critical>0) return 'redbar';
if ($limit>=$warning && $warning>0) return 'orangebar';
return 'greenbar';
} else {
if ($limit<=100-$critical) return 'redbar';
if ($limit<=100-$warning) return 'orangebar';
if ($limit<=100-$critical && $critical>0) return 'redbar';
if ($limit<=100-$warning && $warning>0) return 'orangebar';
return 'greenbar';
}
}