Compare commits
No commits in common. "976e10659f36949a63fdc5207c2b67bbb4f5e644" and "788cf3e9173af683d459f65a9a625191ec9c81b8" have entirely different histories.
976e10659f
...
788cf3e917
5 changed files with 5 additions and 22 deletions
12
.idea/misc.xml
generated
12
.idea/misc.xml
generated
|
|
@ -4,16 +4,8 @@
|
|||
<option name="openedFilesInfos">
|
||||
<list>
|
||||
<OpenedFileInfo>
|
||||
<option name="caretOffset" value="166" />
|
||||
<option name="fileUrl" value="file://$PROJECT_DIR$/app/Auth.php" />
|
||||
</OpenedFileInfo>
|
||||
<OpenedFileInfo>
|
||||
<option name="caretOffset" value="1004" />
|
||||
<option name="fileUrl" value="file://$PROJECT_DIR$/app/App.php" />
|
||||
</OpenedFileInfo>
|
||||
<OpenedFileInfo>
|
||||
<option name="caretOffset" value="0" />
|
||||
<option name="fileUrl" value="file://$PROJECT_DIR$/templates/template.php" />
|
||||
<option name="caretOffset" value="163" />
|
||||
<option name="fileUrl" value="file://$PROJECT_DIR$/templates/partials/menu.php" />
|
||||
</OpenedFileInfo>
|
||||
</list>
|
||||
</option>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ namespace MingTsay\Akanyan;
|
|||
|
||||
abstract class FileViewer
|
||||
{
|
||||
protected static bool $orderDesc = false;
|
||||
|
||||
protected abstract static function directory(): string;
|
||||
|
||||
protected abstract static function whitelist(): ?array;
|
||||
|
|
@ -15,13 +13,10 @@ abstract class FileViewer
|
|||
$directory = static::directory();
|
||||
$whitelist = static::whitelist();
|
||||
|
||||
$list = array_values(array_filter(
|
||||
return array_values(array_filter(
|
||||
scandir($directory),
|
||||
fn($file) => ($whitelist === null || in_array($file, $whitelist)) && is_file("$directory/$file")
|
||||
));
|
||||
|
||||
if (static::$orderDesc) rsort($list);
|
||||
return $list;
|
||||
}
|
||||
|
||||
public static function read($file): ?string
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ namespace MingTsay\Akanyan;
|
|||
|
||||
class LogsViewer extends FileViewer
|
||||
{
|
||||
protected static bool $orderDesc = true;
|
||||
|
||||
protected static function directory(): string
|
||||
{
|
||||
|
|
|
|||
3
composer.lock
generated
3
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "80d3ab8288e7bcecfa9435acfbd3bcc5",
|
||||
"content-hash": "528c716c3d44b77191eaef0461fe108d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "components/font-awesome",
|
||||
|
|
@ -725,6 +725,7 @@
|
|||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"ext-iconv": "*",
|
||||
"ext-sodium": "*",
|
||||
"ext-zlib": "*"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -50,10 +50,6 @@
|
|||
<div class="card-body">
|
||||
<p class="fs-5">【更新紀錄】</p>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<p>檢視日誌時最新的檔案將出現於最前面。</p>
|
||||
<p>更新日期:2022/10/20 20:48:00</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<p>首頁現在可以看到伺服器版本與線上人數等資訊了。</p>
|
||||
<p>更新日期:2022/07/05 02:02:02</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue