Refine admin action buttons and add a system about page

This commit is contained in:
2026-11-25 17:43:57 +08:00
parent 06bf1c8fc0
commit 2e1e43a3ce
19 changed files with 152 additions and 51 deletions
+23 -1
View File
@@ -16,6 +16,7 @@ use App\Content\Repository;
use App\Content\SiteDesign;
use App\Content\View;
use App\Http\Request;
use Composer\InstalledVersions;
use RuntimeException;
use support\Response;
@@ -126,6 +127,24 @@ class AdminController
]);
}
public function about(Request $request): Response
{
if ($failure = $this->guard($request)) {
return $failure;
}
return $this->render($request, 'admin-about', [
'title' => '关于系统',
'systemInfo' => [
'PHP' => PHP_VERSION,
'Webman' => InstalledVersions::getPrettyVersion('workerman/webman-framework'),
'Workerman' => InstalledVersions::getPrettyVersion('workerman/workerman'),
'SQLite' => (string) Database::connect()->query('SELECT sqlite_version()')->fetchColumn(),
'运行平台' => PHP_OS_FAMILY,
],
]);
}
public function articles(Request $request): Response
{
if ($failure = $this->guard($request)) {
@@ -704,7 +723,10 @@ class AdminController
], $status);
}
return View::render($view, $data + ['token' => $token, 'user' => $this->user, 'adminPath' => $request->path()], $status, true);
return View::render($view, $data + [
'token' => $token, 'user' => $this->user, 'adminPath' => $request->path(),
'laysiteVersion' => trim(file_get_contents(dirname(__DIR__, 2) . '/VERSION')),
], $status, true);
}
protected function error(Request $request, string $message, int $status): Response