Skip to content

Commit 8364a98

Browse files
authored
Merge pull request #190 from Miliooo/toolbar_update
[Symfony] added toolbar info in profiler
2 parents bf30d0a + 4ea1a51 commit 8364a98

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed
Loading

pkg/enqueue-bundle/Resources/views/Profiler/panel.html.twig

+31-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
22

33
{% block toolbar %}
4+
{% if collector.sentMessages|length > 0 %}
5+
{% set icon %}
6+
{{ include('@Enqueue/Icon/icon.svg') }}
7+
<span class="sf-toolbar-value">
8+
{{ collector.sentMessages|length }}</span>
9+
{% endset %}
10+
11+
{% set text %}
12+
<div class="sf-toolbar-info-piece">
13+
<b>Sent messages</b>
14+
<span class="sf-toolbar-status">{{ collector.sentMessages|length }}</span>
15+
</div>
16+
{% endset %}
17+
18+
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
19+
{% endif %}
420
{% endblock %}
521

622
{% block menu %}
723
<span class="label {{ not collector.sentMessages ? 'disabled' }}">
24+
<span class="icon">{{ include('@Enqueue/Icon/icon.svg') }}</span>
825
<strong>Message Queue</strong>
926
</span>
1027
{% endblock %}
@@ -13,29 +30,29 @@
1330
<h2>Sent messages</h2>
1431
<table>
1532
<thead>
16-
<tr>
17-
<th>#</th>
18-
<th>Topic</th>
19-
<th>Message</th>
20-
<th>Priority</th>
21-
</tr>
33+
<tr>
34+
<th>#</th>
35+
<th>Topic</th>
36+
<th>Message</th>
37+
<th>Priority</th>
38+
</tr>
2239
</thead>
2340
<tbody>
24-
{% for sentMessage in collector.sentMessages %}
25-
<tr>
26-
<td>{{ loop.index }}</td>
27-
<td>{{ sentMessage.topic }}</td>
28-
<td style="width: 70%">
41+
{% for sentMessage in collector.sentMessages %}
42+
<tr>
43+
<td>{{ loop.index }}</td>
44+
<td>{{ sentMessage.topic }}</td>
45+
<td style="width: 70%">
2946
<span class="metadata">
3047
<span>{{ sentMessage.body[0:40] }}... </span><a class="btn btn-link text-small sf-toggle" data-toggle-selector="#message-body-{{ loop.index }}" data-toggle-alt-content="Hide trace">Show trace</a>
3148

3249
<div id="message-body-{{ loop.index }}" class="context sf-toggle-content sf-toggle-hidden">
3350
{{ profiler_dump(sentMessage.body) }}
3451
</div>
3552
</span>
36-
<td><span title="{{ sentMessage.priority }}">{{ collector.prettyPrintPriority(sentMessage.priority) }}</span></td>
37-
</tr>
38-
{% endfor %}
53+
<td><span title="{{ sentMessage.priority }}">{{ collector.prettyPrintPriority(sentMessage.priority) }}</span></td>
54+
</tr>
55+
{% endfor %}
3956
</tbody>
4057

4158
</table>

0 commit comments

Comments
 (0)