print last line of log

This commit is contained in:
Timendum 2016-07-12 18:35:55 +02:00
parent ea5f79737e
commit 1f736ea940
2 changed files with 3 additions and 1 deletions

View file

@ -55,8 +55,10 @@ class FileHandler
try { try {
$lines = explode("\r", file_get_contents($file)); $lines = explode("\r", file_get_contents($file));
$content["lastline"] = array_slice($lines, -1)[0];
$content["100"] = strpos($lines[count($lines)-1], ' 100% of ') > 0; $content["100"] = strpos($lines[count($lines)-1], ' 100% of ') > 0;
} catch (Exception $e) { } catch (Exception $e) {
$content["lastline"] = '';
$content["100"] = False; $content["100"] = False;
} }
try { try {

View file

@ -43,7 +43,7 @@
foreach($files as $f) foreach($files as $f)
{ {
echo "<tr>"; echo "<tr>";
echo "<td><a href=\"".rawurlencode($file->get_logs_folder()).'/'.rawurlencode($f["name"])."\" target=\"_blank\">".$f["name"]."</a></td>"; echo "<td><div><a href=\"".rawurlencode($file->get_logs_folder()).'/'.rawurlencode($f["name"])."\" target=\"_blank\">".$f["name"]."</a></div><div>".$f["lastline"]."</div></td>";
echo "<td>".($f["ended"] ? '&#10003;' : '')."</td>"; echo "<td>".($f["ended"] ? '&#10003;' : '')."</td>";
echo "<td>".($f["100"] ? '&#10003;' : '')."</td>"; echo "<td>".($f["100"] ? '&#10003;' : '')."</td>";
echo "<td>".$f["size"]."</td>"; echo "<td>".$f["size"]."</td>";