Check upstream versions and label article-driven components

This commit is contained in:
2026-11-25 22:57:47 +08:00
parent 4ea5d2c133
commit 04cac36b83
14 changed files with 123 additions and 11 deletions
+14 -1
View File
@@ -17,6 +17,7 @@ use App\Content\Passwords;
use App\Content\Repository;
use App\Content\SiteDesign;
use App\Content\SystemInfo;
use App\Content\Updates;
use App\Content\View;
use App\Http\Request;
use RuntimeException;
@@ -160,6 +161,18 @@ class AdminController
return $this->json(SystemInfo::sample());
}
public function aboutUpdate(Request $request): Response
{
if ($failure = $this->guard($request)) {
return $failure;
}
try {
return $this->json(Updates::check());
} catch (RuntimeException $error) {
return $this->json(['message' => $error->getMessage()], 502);
}
}
public function aboutLicense(Request $request, string $key): Response
{
if ($failure = $this->guard($request)) {
@@ -756,7 +769,7 @@ class AdminController
return View::render($view, $data + [
'token' => $token, 'user' => $this->user, 'adminPath' => $request->path(),
'laysiteVersion' => trim(file_get_contents(dirname(__DIR__, 2) . '/VERSION')),
'laysiteVersion' => Updates::current(),
], $status, true);
}