Files
iTop/lib/symfony/web-profiler-bundle/Resources/views/Profiler/results.html.twig
bdalsass 79da71ecf8 migration symfony 5 4 (#300)
* symfony 5.4 (diff dev)

* symfony 5.4 (working)

* symfony 5.4 (update autoload)

* symfony 5.4 (remove swiftmailer mailer implementation)

* symfony 5.4 (php doc and split Global accessor class)


### Impacted packages:

composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies

composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
2022-06-16 09:13:24 +02:00

68 lines
2.8 KiB
Twig

{% extends '@WebProfiler/Profiler/layout.html.twig' %}
{% macro profile_search_filter(request, result, property) %}
{%- if request.hasSession -%}
<a href="{{ path('_profiler_search_results', request.query.all|merge({token: result.token})|merge({ (property): result[property] })) }}" title="Search"><span title="Search" class="sf-icon sf-search">{{ include('@WebProfiler/Icon/search.svg') }}</span></a>
{%- endif -%}
{% endmacro %}
{% import _self as helper %}
{% block summary %}
<div class="status">
<div class="container">
<h2>Profile Search</h2>
</div>
</div>
{% endblock %}
{% block panel %}
<h2>{{ tokens ? tokens|length : 'No' }} results found</h2>
{% if tokens %}
<table id="search-results">
<thead>
<tr>
<th scope="col" class="text-center">Status</th>
<th scope="col">IP</th>
<th scope="col">Method</th>
<th scope="col">URL</th>
<th scope="col">Time</th>
<th scope="col">Token</th>
</tr>
</thead>
<tbody>
{% for result in tokens %}
{% set css_class = result.status_code|default(0) > 399 ? 'status-error' : result.status_code|default(0) > 299 ? 'status-warning' : 'status-success' %}
<tr>
<td class="text-center">
<span class="label {{ css_class }}">{{ result.status_code|default('n/a') }}</span>
</td>
<td>
<span class="nowrap">{{ result.ip }} {{ helper.profile_search_filter(request, result, 'ip') }}</span>
</td>
<td>
<span class="nowrap">{{ result.method }} {{ helper.profile_search_filter(request, result, 'method') }}</span>
</td>
<td class="break-long-words">
{{ result.url }}
{{ helper.profile_search_filter(request, result, 'url') }}
</td>
<td class="text-small">
<span class="nowrap">{{ result.time|date('d-M-Y') }}</span>
<span class="nowrap newline">{{ result.time|date('H:i:s') }}</span>
</td>
<td class="nowrap"><a href="{{ path('_profiler', { token: result.token }) }}">{{ result.token }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="empty">
<p>The query returned no result.</p>
</div>
{% endif %}
{% endblock %}