mirror of
https://github.com/timendum/Youtube-dl-WebUI.git
synced 2025-03-01 08:03:28 +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 = [];
|
||||||
$content["name"] = str_replace($folder, "", $file);
|
$content["name"] = str_replace($folder, "", $file);
|
||||||
$content["size"] = $this->to_human_filesize(filesize($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;
|
$files[] = $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
logs.php
4
logs.php
|
@ -31,6 +31,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="min-width:800px; height:35px">Timestamp</th>
|
<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:80px">Size</th>
|
||||||
<th style="min-width:110px">Delete link</th>
|
<th style="min-width:110px">Delete link</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
{
|
{
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td><a href=\"".rawurlencode($file->get_logs_folder()).'/'.rawurlencode($f["name"])."\" target=\"_blank\">".$f["name"]."</a></td>";
|
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>".$f["size"]."</td>";
|
||||||
echo "<td><a href=\"./logs.php?delete=".sha1($f["name"])."\" class=\"btn btn-danger btn-sm\">Delete</a></td>";
|
echo "<td><a href=\"./logs.php?delete=".sha1($f["name"])."\" class=\"btn btn-danger btn-sm\">Delete</a></td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
@ -62,4 +64,4 @@
|
||||||
</div><!-- End container -->
|
</div><!-- End container -->
|
||||||
<?php
|
<?php
|
||||||
require 'views/footer.php';
|
require 'views/footer.php';
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue