File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 11{% extends ' @WebProfiler/Profiler/layout.html.twig' %}
22
3+ {% import _self as helper %}
4+
35{% block toolbar %}
46 {% if collector .requestCount %}
57 {% set icon %}
8890 {% if trace .options is not empty %}
8991 {{ profiler_dump(trace .options , maxDepth=1) }}
9092 {% endif %}
93+ <button class =" btn btn-sm" data-clipboard-text =" {{ helper.render_curl (trace ) }}" >Copy-as-Curl</button >
9194 </th >
9295 {% if profiler_token and profiler_link %}
9396 <th >
121124 </tr >
122125 </tbody >
123126 </table >
127+ {# tmp: introspect the "trace" #}
128+ {{ dump (trace ) }}
124129 {% endfor %}
125130 {% endif %}
126131 </div >
127132 </div >
128133 {% endfor %}
129134 {% endif %}
130135 </div >
136+
137+ <script type =" text/javascript" >// <![CDATA[
138+
139+ document .querySelectorAll (' [data-clipboard-text]' ).forEach (function (button ) {
140+ button .addEventListener (' click' , function () {
141+ navigator .clipboard .writeText (button .getAttribute (' data-clipboard-text' ));
142+ })
143+ });
144+
145+ // ]]> </script >
146+
131147{% endblock %}
148+
149+ {% macro render_curl(trace ) %}
150+ curl "{{ trace .url }}" --compressed -H "Connection: keep-alive" -v
151+ {% endmacro %}
You can’t perform that action at this time.
0 commit comments