fixes for clockwork web UI

This commit is contained in:
Andy Miller 2024-10-08 15:54:59 +01:00
parent 6a585857b0
commit ca1e5ebb8a
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0
2 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,10 @@
# v1.7.47
## mm/dd/2024
1. [](#improved)
* Fixed an issue with Clockwork Debugger to allow web UI
* Updated vendor libs to latest versions
# v1.7.46
## 05/15/2024

View File

@ -279,11 +279,7 @@ class Debugger
->withHeader('X-Clockwork-Id', $clockworkRequest->id)
->withHeader('X-Clockwork-Version', $clockwork::VERSION);
$grav = Grav::instance();
$basePath = $this->grav['base_url_relative'] . $grav['pages']->base();
if ($basePath) {
$response = $response->withHeader('X-Clockwork-Path', $basePath . '/__clockwork/');
}
$response = $response->withHeader('X-Clockwork-Path', Utils::url('/__clockwork/'));
return $response->withHeader('Server-Timing', ServerTiming::fromRequest($clockworkRequest)->value());
}
@ -307,7 +303,7 @@ class Debugger
}
$id = $matches['id'] ?? null;
$direction = $matches['direction'] ?? null;
$direction = $matches['direction'] ?? 'latest';
$count = $matches['count'] ?? null;
$storage = $clockwork->getStorage();
@ -316,7 +312,7 @@ class Debugger
$data = $storage->previous($id, $count);
} elseif ($direction === 'next') {
$data = $storage->next($id, $count);
} elseif ($id === 'latest') {
} elseif ($direction === 'latest' || $id === 'latest') {
$data = $storage->latest();
} else {
$data = $storage->find($id);