8000 [WebProfilerBundle][HttpClient] Added profiler links in the Web Profi… · symfony/symfony@70e11f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 70e11f9

Browse files
cristagufabpot
authored andcommitted
[WebProfilerBundle][HttpClient] Added profiler links in the Web Profiler -> Http Client panel
1 parent af4035d commit 70e11f9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/http_client.html.twig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@
5454
{% else %}
5555
<h4>Requests</h4>
5656
{% for trace in client.traces %}
57+
{% set profiler_token = '' %}
58+
{% set profiler_link = '' %}
59+
{% if trace.info.response_headers is defined %}
60+
{% for header in trace.info.response_headers %}
61+
{% if header matches '/^x-debug-token: .*$/i' %}
62+
{% set profiler_token = (header.getValue | slice('x-debug-token: ' | length)) %}
63+
{% endif %}
64+
{% if header matches '/^x-debug-token-link: .*$/i' %}
65+
{% set profiler_link = (header.getValue | slice('x-debug-token-link: ' | length)) %}
66+
{% endif %}
67+
{% endfor %}
68+
{% endif %}
5769
<table>
5870
<thead>
5971
<tr>
@@ -66,6 +78,11 @@
6678
{{ profiler_dump(trace.options, maxDepth=1) }}
6779
{% endif %}
6880
</th>
81+
{% if profiler_token and profiler_link %}
82+
<th>
83+
Profile
84+
</th>
85+
{% endif %}
6986
</tr>
7087
</thead>
7188
<tbody>
@@ -85,6 +102,11 @@
85102
<td>
86103
{{ profiler_dump(trace.info, maxDepth=1) }}
87104
</td>
105+
{% if profiler_token and profiler_link %}
106+
<td>
107+
<span><a href="{{ profiler_link }}" target="_blank">{{ profiler_token }}</a></span>
108+
</td>
109+
{% endif %}
88110
</tr>
89111
</tbody>
90112
</table>

0 commit comments

Comments
 (0)
0