Auto-load only new log data

This is way more complicated that just reloading the log file, but also
way nicer.

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl
2026-02-24 12:32:54 +01:00
parent 0633f665d5
commit 680a2fefcb
7 changed files with 261 additions and 55 deletions

View File

@@ -11,6 +11,7 @@ ini_set('max_execution_time', '7200');
ini_set('log_errors_max_len', '0');
use DI\Container;
use DI\NotFoundException;
use Slim\Csrf\Guard;
use Slim\Factory\AppFactory;
use Slim\Views\Twig;
@@ -171,6 +172,15 @@ $app->get('/setup', function (Request $request, Response $response, array $args)
]
);
});
$app->get('/log', function (Request $request, Response $response, array $args) use ($container) {
$params = $request->getQueryParams();
$id = $params['id'] ?? '';
if (!str_starts_with($id, 'nextcloud-aio-')) {
throw new DI\NotFoundException();
}
$view = Twig::fromRequest($request);
return $view->render($response, 'log.twig', ['id' => $id]);
});
// Auth Redirector
$app->get('/', function (\Psr\Http\Message\RequestInterface $request, Response $response, array $args) use ($container) {