mirror of
https://github.com/timendum/Youtube-dl-WebUI.git
synced 2025-02-28 23:53:10 +08:00
Added status for log file
This commit is contained in:
parent
182dc7a7f4
commit
fb306f368f
2 changed files with 11 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
4
logs.php
4
logs.php
|
@ -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"] ? '✓' : '')."</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';
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue