diff --git a/src/Controller/RunController.php b/src/Controller/RunController.php index 6c58c72ba..de0a81953 100644 --- a/src/Controller/RunController.php +++ b/src/Controller/RunController.php @@ -37,7 +37,7 @@ public function index(Request $request, Response $response): void $response->headers->set('Cache-Control', 'public, max-age=0'); $search = []; - $keys = ['date_start', 'date_end', 'url']; + $keys = ['date_start', 'date_end', 'server_name', 'url']; foreach ($keys as $key) { if ($request->get($key)) { $search[$key] = $request->get($key); @@ -203,7 +203,7 @@ public function url(Request $request): void ]; $search = []; - $keys = ['date_start', 'date_end', 'limit', 'limit_custom']; + $keys = ['date_start', 'date_end', 'limit', 'limit_custom', 'server_name']; foreach ($keys as $key) { $search[$key] = $request->get($key); } @@ -262,7 +262,8 @@ public function compare(Request $request): void ]; $candidates = $this->searcher->getForUrl( $baseRun->getMeta('simple_url'), - $pagination + $pagination, + ['server_name' => $baseRun->getMeta('SERVER.SERVER_NAME')] ); $paging = [ diff --git a/src/Db/Mapper.php b/src/Db/Mapper.php index e681d42c7..511cfe4ed 100644 --- a/src/Db/Mapper.php +++ b/src/Db/Mapper.php @@ -46,6 +46,9 @@ private function buildConditions(array $search): array if (!empty($search['date_end']) && !$hasLimit) { $conditions['meta.request_date']['$lte'] = (string)$search['date_end']; } + if (!empty($search['server_name'])) { + $conditions['meta.SERVER.SERVER_NAME'] = (string)$search['server_name']; + } if (isset($search['simple_url'])) { $conditions['meta.simple_url'] = (string)$search['simple_url']; } diff --git a/templates/runs/compare.twig b/templates/runs/compare.twig index 7cbe9cf7e..29d160801 100644 --- a/templates/runs/compare.twig +++ b/templates/runs/compare.twig @@ -2,11 +2,11 @@ {% import 'macros/helpers.twig' as helpers %} {% block title %} -- Compare - {{ base_run.meta.simple_url }} +- Compare - {{ base_run.meta.SERVER.SERVER_NAME }}{{ base_run.meta.simple_url }} {% endblock %} {% block content %} -