Skip to content

Commit 08b8fbf

Browse files
committed
show profiler badges in the toolbar and the menu
1 parent f429995 commit 08b8fbf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- The profiler collector has been rewritten to use objects instead of arrays.
88
- Bumped minimum Symfony version to 2.8.
9+
- Updated profiler badges to match Symfony 2.8+ profiler design.
910

1011
### Fixed
1112

Resources/views/webprofiler.html.twig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
{% set text %}
1414
<div class="sf-toolbar-info-piece">
1515
<b>Successful requests</b>
16-
<span>{{ collector.successfulStacks|length }}</span>
16+
<span class="sf-toolbar-status">{{ collector.successfulStacks|length }}</span>
1717
</div>
1818
<div class="sf-toolbar-info-piece">
1919
<b>Failed requests</b>
20-
<span>{{ collector.failedStacks|length }}</span>
20+
<span class="sf-toolbar-status {{ collector.failedStacks|length ? 'sf-toolbar-status-red' }}">{{ collector.failedStacks|length }}</span>
2121
</div>
2222
{% endset %}
2323

24-
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
24+
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.failedStacks|length ? 'red' : '' } %}
2525
{% endif %}
2626
{% endblock %}
2727

@@ -33,11 +33,16 @@
3333

3434
{% block menu %}
3535
{# This left-hand menu appears when using the full-screen profiler. #}
36-
<span class="label {{ collector.stacks|length == 0 ? 'disabled' }}">
36+
<span class="label {{ collector.stacks|length == 0 ? 'disabled' }} {{ collector.failedStacks|length ? 'label-status-error' }}">
3737
<span class="icon">
3838
{{ include('@Httplug/Icon/httplug.svg') }}
3939
</span>
4040
<strong>Httplug</strong>
41+
{% if collector.failedStacks|length %}
42+
<span class="count">
43+
<span>{{ collector.failedStacks|length }}</span>
44+
</span>
45+
{% endif %}
4146
</span>
4247
{% endblock %}
4348

0 commit comments

Comments
 (0)