-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathgeocoder.html.twig
136 lines (128 loc) · 5.59 KB
/
geocoder.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
{% block toolbar %}
{% set queryLabel = collector.queries|length == 1 ? 'query' : 'queries' %}
{% if collector.queries|length > 0 %}
{% set icon %}
{{ include('@BazingaGeocoder/Collector/icon.svg') }}
<span class="sf-toolbar-value">{{ collector.queries|length }}</span>
<span class="sf-toolbar-label">{{ queryLabel }} in</span>
<span class="sf-toolbar-value">{{ collector.totalDuration|number_format }}</span>
<span class="sf-toolbar-label">ms</span>
{% endset %}
{% set text %}
<div class="sf-toolbar-info-piece">
<b>{{ collector.queries|length }} {{ queryLabel }}</b>
</div>
<div class="sf-toolbar-info-piece">
<table class="sf-toolbar-ajax-requests">
<thead>
<tr>
<th>Provider</th>
<th>Query</th>
<th>Time</th>
</tr>
</thead>
<tbody class="sf-toolbar-ajax-request-list">
{% for query in collector.queries %}
<tr>
<td>{{ query.providerName }}</td>
<td>{{ query.queryString }}</td>
<td>{{ query.duration == 0 ? 'n/a' : query.duration|number_format ~ ' ms'}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endset %}
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endif %}
{% endblock %}
{% block menu %}
{# This left-hand menu appears when using the full-screen profiler. #}
<span class="label {{ collector.queries|length == 0 ? 'disabled' }}">
<span class="icon">
{{ include('@BazingaGeocoder/Collector/icon.svg') }}
</span>
<strong>Geocoder</strong>
</span>
{% endblock %}
{% block panel %}
<style>
.sf-toggle-content.sf-toggle-visible {
display: table-row;
}
</style>
<h2>Geocoder</h2>
<div class="sf-tabs">
{% for provider in collector.providers %}
<div class="tab">
<h3 class="tab-title">{{ provider }} <span class="badge">{{ collector.providerQueries(provider)|length }}</span></h3>
<div class="tab-content">
<p class="help">
These queries are executed by a provider named "{{ provider }}".
</p>
<table>
<thead>
<tr>
<th style="min-width: 2rem;"></th>
<th style="width: 40%">Query</th>
<th style="min-width: 3rem;">Locale</th>
<th style="width: 60%">Result</th>
<th style="min-width: 4rem;">Duration</th>
</tr>
</thead>
<tbody>
{% for query in collector.providerQueries(provider) %}
<tr>
<td class="font-normal text-small" nowrap="">
<span class="colored text-bold"># {{ loop.index }}</span>
</td>
<td class="font-normal">
<span class="dump-inline">
{{ query.queryString }}
</span>
</td>
<td class="font-normal">
<span class="dump-inline">
{{ query.query.locale is not null ? query.query.locale : 'null' }}
</span>
</td>
<td class="font-normal">
<span class="dump-inline">
{% if query.result.message is defined %}
Exception
{% else %}
{{ profiler_dump(query.resultCount) }} Result(s)
{% endif %}
</span>
<span class="metadata">
<a class="btn btn-link text-small sf-toggle" data-toggle-selector="#geocoder-{{ provider }}-{{ loop.index }}-details" data-toggle-alt-content="Hide">Show</a>
</span>
</td>
<td class="font-normal text-small" nowrap="">
{{ query.duration|number_format }} ms
</td>
</tr>
<tr id="geocoder-{{ provider }}-{{ loop.index }}-details" class="context sf-toggle-content sf-toggle-hidden">
<td></td>
<td>{{ profiler_dump(query.query, maxDepth=1) }}</td>
<td></td>
{% if query.result.message is defined %}
<td>{{ profiler_dump(query.result, maxDepth=1) }}</td>
{% else %}
<td>{{ profiler_dump(query.result, maxDepth=3) }}</td>
{% endif %}
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
<div class="empty">
<p>No queries were executed.</p>
</div>
{% endfor %}
</div>
{% endblock %}