Skip to content

Commit

Permalink
fixes for clockwork web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 8, 2024
1 parent 6a58585 commit ca1e5eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 3 additions & 7 deletions system/src/Grav/Common/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,7 @@ public function logRequest(ServerRequestInterface $request, ResponseInterface $r
->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());
}
Expand All @@ -307,7 +303,7 @@ public function debuggerRequest(RequestInterface $request): Response
}

$id = $matches['id'] ?? null;
$direction = $matches['direction'] ?? null;
$direction = $matches['direction'] ?? 'latest';
$count = $matches['count'] ?? null;

$storage = $clockwork->getStorage();
Expand All @@ -316,7 +312,7 @@ public function debuggerRequest(RequestInterface $request): Response
$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);
Expand Down

0 comments on commit ca1e5eb

Please sign in to comment.