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);
}
+2 -1
View File
@@ -11,6 +11,7 @@ use App\Content\DesignLibrary;
use App\Content\PageDraft;
use App\Content\PageTemplates;
use App\Content\Repository;
use App\Content\Updates;
use App\Content\View;
use PDOException;
use RuntimeException;
@@ -67,7 +68,7 @@ final class McpController
return match ($method) {
'initialize' => $this->result($id, [
'protocolVersion' => in_array($params['protocolVersion'] ?? null, self::PROTOCOLS, true) ? $params['protocolVersion'] : self::PROTOCOLS[0],
'capabilities' => ['tools' => (object) []], 'serverInfo' => ['name' => 'laysite', 'version' => trim(file_get_contents(dirname(__DIR__, 2) . '/VERSION'))],
'capabilities' => ['tools' => (object) []], 'serverInfo' => ['name' => 'laysite', 'version' => Updates::current()],
'instructions' => 'Create or revise draft pages. A human can open the editor URL to review, refine and publish.',
]),
'ping' => $this->result($id, (object) []),