Skip to content

Commit

Permalink
Merge pull request #425 from koekaverna/server-name
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Sep 18, 2021
2 parents 329bab0 + ed1cb7b commit 26000d2
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 13 deletions.
7 changes: 4 additions & 3 deletions src/Controller/RunController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 = [
Expand Down
3 changes: 3 additions & 0 deletions src/Db/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand Down
4 changes: 2 additions & 2 deletions templates/runs/compare.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<h1>Compare runs for {{ base_run.meta.simple_url }}</h1>
<h1>Compare runs for {{ base_run.meta.SERVER.SERVER_NAME }}{{ base_run.meta.simple_url }}</h1>

{% if not base_run %}
<div class="row-fluid row-spaced">
Expand Down
4 changes: 4 additions & 0 deletions templates/runs/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
</div>
</div>
<div class="control-group span4">
<label class="control-label" for="server-name">Server Name</label>
<div class="controls">
<input type="text" id="server-name" name="server_name" value="{{ search.server_name }}">
</div>
<label class="control-label" for="url">URL</label>
<div class="controls">
<input type="text" id="url" name="url" value="{{ search.url }}">
Expand Down
13 changes: 10 additions & 3 deletions templates/runs/paginated-list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
{% if show_compare_link %}
<th>&nbsp;</th>
{% endif %}
<th>
Server Name
</th>
<th>
Method
</th>
Expand Down Expand Up @@ -49,18 +52,22 @@
</a>
</td>
{% endif %}
<td>
<a href="{{ url('home', {'server_name': result.meta('SERVER.SERVER_NAME')}) }}">
{{result.meta('SERVER.SERVER_NAME')}}
</a>
</td>
<td>
<a href="{{ url('run.view', {'id': result.id|trim }) }}">
{{result.meta('SERVER.REQUEST_METHOD')}}
</a>
</td>
<td>
{% set addr = result.meta('SERVER.SERVER_NAME') ~ result.meta.url %}
{{ helpers.tip_link(
addr,
result.meta.url,
50,
'url.view',
{'url': result.meta.simple_url}
{'server_name': result.meta('SERVER.SERVER_NAME'), 'url': result.meta.simple_url}
) }}
</td>
<td>
Expand Down
3 changes: 2 additions & 1 deletion templates/runs/url.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% endblock %}

{% block content %}
<h1>Runs for {{ url }} (simplified)</h1>
<h1>Runs for {{ search.server_name }}{{ url }} (simplified)</h1>

<div class="row-fluid">
<div id="time-line-graph" class="chart-container span6"></div>
Expand All @@ -19,6 +19,7 @@
</a>

<form action="{{ url('url.view') }}" method="get" class="row hide search-form form-inline">
<input type="hidden" name="server_name" value="{{ search.server_name }}" />
<input type="hidden" name="url" value="{{ search.url }}" />
<a href="#" class="search-collapse close" title="Hide search form">&times;</a>
<div class="control-group span4">
Expand Down
2 changes: 1 addition & 1 deletion templates/runs/view.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% block content %}
<div class="row-fluid">
<h1>Profile data for {{ result.meta('SERVER.REQUEST_METHOD')}} {{ result.meta.url }}</h1>
<h1>Profile data for {{ result.meta('SERVER.REQUEST_METHOD')}} {{ result.meta.SERVER.SERVER_NAME }}{{ result.meta.url }}</h1>
</div>
<div class="row-fluid">
<div class="span3">
Expand Down
13 changes: 10 additions & 3 deletions templates/waterfall/list.twig
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
{% if show_compare_link %}
<th>&nbsp;</th>
{% endif %}
<th>
Server Name
</th>
<th>
Method
</th>
Expand Down Expand Up @@ -98,18 +101,22 @@
</a>
</td>
{% endif %}
<td>
<a href="{{ url('home', {'server_name': result.meta('SERVER.SERVER_NAME')}) }}">
{{result.meta('SERVER.SERVER_NAME')}}
</a>
</td>
<td>
<a href="{{ url('run.view', {'id': result.id|trim }) }}">
{{result.meta('SERVER.REQUEST_METHOD')}}
</a>
</td>
<td>
{% set addr = result.meta('SERVER.SERVER_NAME') ~ result.meta.url %}
{{ helpers.tip_link(
addr,
result.meta.url,
50,
'url.view',
{'url': result.meta.url}
{'server_name': result.meta('SERVER.SERVER_NAME'), 'url': result.meta.url}
) }}
</td>
<td><a href="{{ url('run.view', {'id': result.id|trim }) }}">{{ result.date|date(date_format) }}</a></td>
Expand Down

0 comments on commit 26000d2

Please sign in to comment.