diff --git a/.idea/misc.xml b/.idea/misc.xml index 33fe132..1f3de73 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,8 +4,16 @@ diff --git a/app/FileViewer.php b/app/FileViewer.php index 5a72d3c..e90b65b 100644 --- a/app/FileViewer.php +++ b/app/FileViewer.php @@ -4,6 +4,8 @@ namespace MingTsay\Akanyan; abstract class FileViewer { + protected static bool $orderDesc = false; + protected abstract static function directory(): string; protected abstract static function whitelist(): ?array; @@ -13,10 +15,13 @@ abstract class FileViewer $directory = static::directory(); $whitelist = static::whitelist(); - return array_values(array_filter( + $list = 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 diff --git a/app/LogsViewer.php b/app/LogsViewer.php index 5835706..911532d 100644 --- a/app/LogsViewer.php +++ b/app/LogsViewer.php @@ -4,6 +4,7 @@ namespace MingTsay\Akanyan; class LogsViewer extends FileViewer { + protected static bool $orderDesc = true; protected static function directory(): string { diff --git a/composer.lock b/composer.lock index ed4261f..167ae09 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "528c716c3d44b77191eaef0461fe108d", + "content-hash": "80d3ab8288e7bcecfa9435acfbd3bcc5", "packages": [ { "name": "components/font-awesome", @@ -725,7 +725,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "ext-iconv": "*", "ext-sodium": "*", "ext-zlib": "*" }, diff --git a/templates/index.php b/templates/index.php index ce92289..28192f9 100644 --- a/templates/index.php +++ b/templates/index.php @@ -50,6 +50,10 @@
【更新紀錄】
檢視日誌時最新的檔案將出現於最前面。
+更新日期:2022/10/20 20:48:00
+首頁現在可以看到伺服器版本與線上人數等資訊了。
更新日期:2022/07/05 02:02:02