Added status for log file

This commit is contained in:
Timendum 2016-06-20 10:39:06 +02:00
parent 182dc7a7f4
commit fb306f368f
2 changed files with 11 additions and 2 deletions

View file

@ -52,7 +52,14 @@ class FileHandler
$content = [];
$content["name"] = str_replace($folder, "", $file);
$content["size"] = $this->to_human_filesize(filesize($file));
try {
$lines = explode("\r", file_get_contents($file));
$content["100"] = strpos($lines[count($lines)-1], ' in ') > 0;
} catch (Exception $e) {
$content["100"] = False;
}
$files[] = $content;
}

View file

@ -31,6 +31,7 @@
<thead>
<tr>
<th style="min-width:800px; height:35px">Timestamp</th>
<th style="min-width:80px">Ended</th>
<th style="min-width:80px">Size</th>
<th style="min-width:110px">Delete link</th>
</tr>
@ -42,6 +43,7 @@
{
echo "<tr>";
echo "<td><a href=\"".rawurlencode($file->get_logs_folder()).'/'.rawurlencode($f["name"])."\" target=\"_blank\">".$f["name"]."</a></td>";
echo "<td>".($f["100"] ? '&#10003;' : '')."</td>";
echo "<td>".$f["size"]."</td>";
echo "<td><a href=\"./logs.php?delete=".sha1($f["name"])."\" class=\"btn btn-danger btn-sm\">Delete</a></td>";
echo "</tr>";
@ -62,4 +64,4 @@
</div><!-- End container -->
<?php
require 'views/footer.php';
?>
?>