Skip to content

Commit 70574d8

Browse files
committed
update search UI
1 parent b39de74 commit 70574d8

File tree

4 files changed

+72
-12
lines changed

4 files changed

+72
-12
lines changed

src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ public function searchAction(Request $request): Response
313313
'start' => $start,
314314
'end' => $end,
315315
'limit' => $limit,
316+
'type' => $profileType,
316317
]), 302, ['Content-Type' => 'text/html']);
317318
}
318319

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{% block sidebar_shortcuts_links %}
2929
<div class="shortcuts">
3030
<a class="btn btn-link" href="{{ path('_profiler_search', { limit: 10, type: profile_type }) }}">Last 10</a>
31-
<a class="btn btn-link" href="{{ path('_profiler', { token: 'latest' }|merge(request.query.all)) }}">Latest</a>
31+
<a class="btn btn-link" href="{{ path('_profiler', { token: 'latest', type: profile_type }|merge(request.query.all)) }}">Latest</a>
3232

3333
<a class="sf-toggle btn btn-link" data-toggle-selector="#sidebar-search" {% if tokens is defined or about is defined %}data-toggle-initial="display"{% endif %}>
3434
{{ source('@WebProfiler/Icon/search.svg') }} <span class="hidden-small">Search</span>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.html.twig

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,45 @@
2626
<table id="search-results">
2727
<thead>
2828
<tr>
29-
<th scope="col" class="text-center">Status</th>
30-
<th scope="col">IP</th>
31-
<th scope="col">Method</th>
32-
<th scope="col">URL</th>
29+
<th scope="col" class="text-center">
30+
{% if 'command' == profile_type %}
31+
Exit code
32+
{% else %}
33+
Status
34+
{% endif %}
35+
</th>
36+
<th scope="col">
37+
{% if 'command' == profile_type %}
38+
Application
39+
{% else %}
40+
IP
41+
{% endif %}
42+
</th>
43+
<th scope="col">
44+
{% if 'command' == profile_type %}
45+
Mode
46+
{% else %}
47+
Method
48+
{% endif %}
49+
</th>
50+
<th scope="col">
51+
{% if 'command' == profile_type %}
52+
Command
53+
{% else %}
54+
URL
55+
{% endif %}
56+
</th>
3357
<th scope="col">Time</th>
3458
<th scope="col">Token</th>
3559
</tr>
3660
</thead>
3761
<tbody>
3862
{% for result in tokens %}
39-
{% set css_class = result.status_code|default(0) > 399 ? 'status-error' : result.status_code|default(0) > 299 ? 'status-warning' : 'status-success' %}
63+
{% if 'command' == profile_type %}
64+
{% set css_class = result.status_code == 113 ? 'status-warning' : result.status_code > 0 ? 'status-error' : 'status-success' %}
65+
{% else %}
66+
{% set css_class = result.status_code|default(0) > 399 ? 'status-error' : result.status_code|default(0) > 299 ? 'status-warning' : 'status-success' %}
67+
{% endif %}
4068

4169
<tr>
4270
<td class="text-center">

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/search.html.twig

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,60 @@
11
<div id="sidebar-search" class="{{ (render_hidden_by_default ?? true) ? 'hidden' }}">
22
<form action="{{ path('_profiler_search') }}" method="get">
33
<div class="form-group">
4-
<label for="ip">IP</label>
4+
<label for="ip">
5+
{% if 'command' == profile_type %}
6+
Application
7+
{% else %}
8+
IP
9+
{% endif %}
10+
</label>
511
<input type="text" name="ip" id="ip" value="{{ ip }}">
612
</div>
713

814
<div class="form-group-row">
915
<div class="form-group">
10-
<label for="method">Method</label>
16+
<label for="method">
17+
{% if 'command' == profile_type %}
18+
Mode
19+
{% else %}
20+
Method
21+
{% endif %}
22+
</label>
1123
<select name="method" id="method">
1224
<option value="">Any</option>
13-
{% for m in ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT'] %}
25+
{% if 'command' == profile_type %}
26+
{% set methods = ['BATCH', 'INTERACTIVE'] %}
27+
{% else %}
28+
{% set methods = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT'] %}
29+
{% endif %}
30+
{% for m in methods %}
1431
<option {{ m == method ? 'selected="selected"' }}>{{ m }}</option>
1532
{% endfor %}
1633
</select>
1734
</div>
1835

1936
<div class="form-group">
20-
<label for="status_code">Status</label>
21-
<input type="number" name="status_code" id="status_code" min="100" max="599" value="{{ status_code }}">
37+
<label for="status_code">
38+
{% if 'command' == profile_type %}
39+
Exit code
40+
{% set min_and_max = 'min=%d max=%d'|format(0, 255) %}
41+
{% else %}
42+
Status
43+
{% set min_and_max = 'min=%d max=%d'|format(100, 599) %}
44+
{% endif %}
45+
</label>
46+
<input type="number" name="status_code" id="status_code" {{ min_and_max }} value="{{ status_code }}">
2247
</div>
2348
</div>
2449

2550
<div class="form-group">
26-
<label for="url">URL</label>
51+
<label for="url">
52+
{% if 'command' == profile_type %}
53+
Command
54+
{% else %}
55+
URL
56+
{% endif %}
57+
</label>
2758
<input type="text" name="url" id="url" value="{{ url }}">
2859
</div>
2960

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy