|
1 | 1 | {% extends '@WebProfiler/Profiler/layout.html.twig' %} |
2 | 2 |
|
3 | 3 | {% block toolbar %} |
4 | | - {% if collector.sentMessages|length > 0 %} |
| 4 | + {% if collector.count > 0 %} |
5 | 5 | {% set icon %} |
6 | 6 | {{ include('@Enqueue/Icon/icon.svg') }} |
7 | 7 | <span class="sf-toolbar-value"> |
8 | | - {{ collector.sentMessages|length }}</span> |
| 8 | + {{ collector.count }}</span> |
9 | 9 | {% endset %} |
10 | 10 |
|
11 | 11 | {% set text %} |
12 | 12 | <div class="sf-toolbar-info-piece"> |
13 | 13 | <b>Sent messages</b> |
14 | | - <span class="sf-toolbar-status">{{ collector.sentMessages|length }}</span> |
| 14 | + <span class="sf-toolbar-status">{{ collector.count }}</span> |
15 | 15 | </div> |
16 | 16 | {% endset %} |
17 | 17 |
|
|
20 | 20 | {% endblock %} |
21 | 21 |
|
22 | 22 | {% block menu %} |
23 | | - <span class="label {{ not collector.sentMessages ? 'disabled' }}"> |
| 23 | + <span class="label {{ not collector.count ? 'disabled' }}"> |
24 | 24 | <span class="icon">{{ include('@Enqueue/Icon/icon.svg') }}</span> |
25 | 25 | <strong>Message Queue</strong> |
26 | 26 | </span> |
27 | 27 | {% endblock %} |
28 | 28 |
|
29 | 29 | {% block panel %} |
| 30 | + {% if collector.count > 0 %} |
30 | 31 | <h2>Sent messages</h2> |
31 | | - {% if collector.sentMessages|length > 0 %} |
32 | | - <table> |
33 | | - <thead> |
34 | | - <tr> |
35 | | - <th>#</th> |
36 | | - <th>Topic</th> |
37 | | - <th>Command</th> |
38 | | - <th>Message</th> |
39 | | - <th>Priority</th> |
40 | | - </tr> |
41 | | - </thead> |
42 | | - <tbody> |
43 | | - {% for sentMessage in collector.sentMessages %} |
44 | | - <tr> |
45 | | - <td>{{ loop.index }}</td> |
46 | | - <td>{{ sentMessage.topic|default(null) }}</td> |
47 | | - <td>{{ sentMessage.command|default(null) }}</td> |
48 | | - <td style="width: 70%" class="metadata"> |
49 | | - <span> |
50 | | - {% set body = collector.ensureString(sentMessage.body) %} |
51 | | - {{ body|length > 40 ? body|slice(0, 40) ~ '...' : body }} |
52 | | - </span> |
53 | | - {% if body|length > 40 %} |
54 | | - <a class="btn btn-link text-small sf-toggle" |
55 | | - data-toggle-selector="#message-body-{{ loop.index }}" |
56 | | - data-toggle-alt-content="Hide body" |
57 | | - >Show body</a> |
58 | | - <div id="message-body-{{ loop.index }}" |
59 | | - class="context sf-toggle-content sf-toggle-hidden"> |
60 | | - <pre>{{ body }}</pre> |
61 | | - </div> |
62 | | - {% endif %} |
63 | | - <td> |
64 | | - <span title="{{ sentMessage.priority }}">{{ collector.prettyPrintPriority(sentMessage.priority) }}</span> |
65 | | - </td> |
66 | | - </tr> |
67 | | - {% endfor %} |
68 | | - </tbody> |
| 32 | + {% for clientName, sentMessages in collector.sentMessages %} |
| 33 | + {% if sentMessages|length > 0 %} |
| 34 | + <h3>Client: {{ clientName }}</h3> |
| 35 | + <table> |
| 36 | + <thead> |
| 37 | + <tr> |
| 38 | + <th>#</th> |
| 39 | + <th>Topic</th> |
| 40 | + <th>Command</th> |
| 41 | + <th>Message</th> |
| 42 | + <th>Priority</th> |
| 43 | + <th>Time</th> |
| 44 | + </tr> |
| 45 | + </thead> |
| 46 | + <tbody> |
| 47 | + {% for sentMessage in sentMessages %} |
| 48 | + <tr> |
| 49 | + <td>{{ loop.index }}</td> |
| 50 | + <td>{{ sentMessage.topic|default(null) }}</td> |
| 51 | + <td>{{ sentMessage.command|default(null) }}</td> |
| 52 | + <td style="width: 70%" class="metadata"> |
| 53 | + <span> |
| 54 | + {% set body = collector.ensureString(sentMessage.body) %} |
| 55 | + {{ body|length > 40 ? body|slice(0, 40) ~ '...' : body }} |
| 56 | + </span> |
| 57 | + {% if body|length > 40 %} |
| 58 | + <a class="btn btn-link text-small sf-toggle" |
| 59 | + data-toggle-selector="#message-body-{{ loop.index }}" |
| 60 | + data-toggle-alt-content="Hide body" |
| 61 | + >Show body</a> |
| 62 | + <div id="message-body-{{ loop.index }}" |
| 63 | + class="context sf-toggle-content sf-toggle-hidden"> |
| 64 | + <pre>{{ body }}</pre> |
| 65 | + </div> |
| 66 | + {% endif %} |
| 67 | + <td> |
| 68 | + <span title="{{ sentMessage.priority }}">{{ collector.prettyPrintPriority(sentMessage.priority) }}</span> |
| 69 | + </td> |
| 70 | + <td style="white-space:nowrap;"> |
| 71 | + {{ sentMessage.sentAt|date('i:s.v') }} |
| 72 | + </td> |
| 73 | + </tr> |
| 74 | + {% endfor %} |
| 75 | + </tbody> |
69 | 76 |
|
70 | | - </table> |
| 77 | + </table> |
| 78 | + {% endif %} |
| 79 | + {% endfor %} |
71 | 80 | {% else %} |
72 | 81 | <div class="empty"> |
73 | 82 | <p>No messages were sent.</p> |
|
0 commit comments