Tweaks and bug fixes

This commit is contained in:
Javier Eguiluz 2015-07-31 13:11:01 +02:00
parent 9df0f8b4b8
commit 597637ecea
20 changed files with 19 additions and 26 deletions

View File

@ -2,7 +2,7 @@
{% block toolbar %}
{% set icon %}
{{ include('@WebProfiler/Icon/ajax.svg.twig') }}
{{ include('@WebProfiler/Icon/ajax.svg') }}
<span class="sf-toolbar-value sf-toolbar-ajax-requests">0</span>
{% endset %}

View File

@ -21,7 +21,7 @@
{% set icon %}
{% if collector.symfonyState is defined %}
<span class="sf-toolbar-label">
{{ include('@WebProfiler/Icon/symfony.svg.twig') }}
{{ include('@WebProfiler/Icon/symfony.svg') }}
</span>
<span class="sf-toolbar-value">{{ collector.symfonyversion }}</span>
{% elseif collector.applicationname %}
@ -71,7 +71,10 @@
<div class="sf-toolbar-info-piece sf-toolbar-info-php">
<b>PHP version</b>
<span>{{ collector.phpversion }}</span>
<span>
{{ collector.phpversion }}
&nbsp; <a href="{{ path('_profiler_phpinfo') }}">View phpinfo()</a>
</span>
</div>
<div class="sf-toolbar-info-piece sf-toolbar-info-php-ext">

View File

@ -6,7 +6,7 @@
{% if collector.data.nb_errors > 0 or collector.data.forms|length %}
{% set status_color = collector.data.nb_errors ? 'red' : '' %}
{% set icon %}
{{ include('@WebProfiler/Icon/form.svg.twig') }}
{{ include('@WebProfiler/Icon/form.svg') }}
<span class="sf-toolbar-value">
{% if collector.data.nb_errors %}
{{ collector.data.nb_errors }}

View File

@ -7,7 +7,7 @@
{% set icon %}
{% set status_color = collector.counterrors ? 'red' : collector.countdeprecations ? 'yellow' : '' %}
{% set error_count = collector.counterrors + collector.countdeprecations + collector.countscreams %}
{{ include('@WebProfiler/Icon/logger.svg.twig') }}
{{ include('@WebProfiler/Icon/logger.svg') }}
<span class="sf-toolbar-value">{{ error_count }}</span>
{% endset %}
@ -80,7 +80,7 @@
</tr>
</table>
{% if collector.logs %}
{% if collector.logs %}
<table>
<tr>
<th>#</th>

View File

@ -3,7 +3,7 @@
{% block toolbar %}
{% set icon %}
{% set status_color = (collector.memory / 1024 / 1024) > 50 ? 'yellow' : '' %}
{{ include('@WebProfiler/Icon/memory.svg.twig') }}
{{ include('@WebProfiler/Icon/memory.svg') }}
<span class="sf-toolbar-value">{{ '%.1f'|format(collector.memory / 1024 / 1024) }}</span>
<span class="sf-toolbar-label">MB</span>
{% endset %}

View File

@ -21,7 +21,7 @@
{% set status_color = collector.events|length and collector.duration > 1000 ? 'yellow' : '' %}
{% set icon %}
{{ include('@WebProfiler/Icon/time.svg.twig') }}
{{ include('@WebProfiler/Icon/time.svg') }}
<span class="sf-toolbar-value">{{ total_time }}</span>
<span class="sf-toolbar-label">ms</span>
{% endset %}

View File

@ -5,7 +5,7 @@
{% block toolbar %}
{% if collector.messages|length %}
{% set icon %}
{{ include('@WebProfiler/Icon/translation.svg.twig') }}
{{ include('@WebProfiler/Icon/translation.svg') }}
{% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' : '' %}
{% set error_count = collector.countMissings + collector.countFallbacks %}
<span class="sf-toolbar-value">{{ error_count ?: collector.countdefines }}</span>
@ -15,20 +15,20 @@
<div class="sf-toolbar-info-piece">
<b>Missing messages</b>
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.countMissings ? 'red' }}">
{{ collector.countMissings|default(0) }}
{{ collector.countMissings }}
</span>
</div>
<div class="sf-toolbar-info-piece">
<b>Fallback messages</b>
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.countFallbacks ? 'yellow' }}">
{{ collector.countFallbacks|default(0) }}
{{ collector.countFallbacks }}
</span>
</div>
<div class="sf-toolbar-info-piece">
<b>Defined messages</b>
<span class="sf-toolbar-status">{{ collector.countdefines|default(0) }}</span>
<span class="sf-toolbar-status">{{ collector.countdefines }}</span>
</div>
{% endset %}

View File

@ -3,7 +3,7 @@
{% block toolbar %}
{% set time = collector.templatecount ? '%0.0f'|format(collector.time) : 'n/a' %}
{% set icon %}
{{ include('@WebProfiler/Icon/twig.html.twig') }}
{{ include('@WebProfiler/Icon/twig.svg') }}
<span class="sf-toolbar-value">{{ time }}</span>
<span class="sf-toolbar-label">ms</span>
{% endset %}

View File

@ -86,6 +86,7 @@
return;
}
var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
var tbodies = document.querySelectorAll('.sf-toolbar-ajax-request-list');
var state = 'ok';
if (tbodies.length) {
@ -169,7 +170,6 @@
infoSpan.textContent = text;
}
} else {
var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
ajaxToolbarPanel.style.display = 'none';
}
}
@ -179,7 +179,6 @@
var className = 'sf-toolbar-ajax-requests sf-toolbar-value';
requestCounter[0].className = className;
var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
if (state == 'error') {
Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
} else {

View File

@ -85,10 +85,6 @@
color: #AAA;
font-size: 12px;
}
/* TODO: remove it when Twig uses SVG icons */
.sf-toolbar-block-twig img {
opacity: .8;
}
.sf-toolbar-block .sf-toolbar-info {
border-collapse: collapse;
@ -316,11 +312,6 @@
50% { background: #444; }
100% { background: #222; }
}
@-o-keyframes sf-blink {
0% { background: #222; }
50% { background: #444; }
100% { background: #222; }
}
@keyframes sf-blink {
0% { background: #222; }
50% { background: #444; }

View File

@ -15,7 +15,7 @@
Sfjs.setPreference('toolbar/displayState', 'block');
">
{{ include('@WebProfiler/Icon/symfony.svg.twig') }}
{{ include('@WebProfiler/Icon/symfony.svg') }}
</a>
</div>
<style>
@ -44,7 +44,7 @@
document.getElementById('sfMiniToolbar-{{ token }}').style.display = 'block';
Sfjs.setPreference('toolbar/displayState', 'none');
">
{{ include('@WebProfiler/Icon/close.svg.twig') }}
{{ include('@WebProfiler/Icon/close.svg') }}
</a>
{% endif %}
</div>