[WebProfilerBundle] improved the ajax section of the WDT

This commit is contained in:
Fabien Potencier 2014-09-23 15:35:32 +02:00
parent 37f7dd7483
commit d43edaf6a1
3 changed files with 20 additions and 21 deletions

View File

@ -9,20 +9,21 @@
{% endset %}
{% set text %}
<div class="sf-toolbar-info-piece">
<p><b>AJAX requests</b> <span class="sf-toolbar-ajax-info"></span></p>
<div>
<table class="sf-toolbar-ajax-requests">
<thead>
<tr>
<th>Method</th>
<th>URL</th>
<th>Time</th>
<th>Profile</th>
</tr>
</thead>
<tbody class="sf-toolbar-ajax-request-list"></tbody>
</table>
</div>
<b>AJAX requests</b>
<span class="sf-toolbar-ajax-info"></span>
</div>
<div class="sf-toolbar-info-piece">
<table class="sf-toolbar-ajax-requests">
<thead>
<tr>
<th>Method</th>
<th>URL</th>
<th>Time</th>
<th>Profile</th>
</tr>
</thead>
<tbody class="sf-toolbar-ajax-request-list"></tbody>
</table>
</div>
{% endset %}
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %}

View File

@ -144,14 +144,13 @@
var infoSpans = document.getElementsByClassName("sf-toolbar-ajax-info");
if (infoSpans.length) {
var text = firstItem == 0 ? 'Showing ' + requestStack.length + ' items' : 'Showing the last 20 '
+ 'out of ' + requestStack.length + ' items';
var text = firstItem == 0 ? requestStack.length + ' calls' : 'Last 20 calls out of ' + requestStack.length;
infoSpans[0].innerText = text;
}
} else {
var cell = document.createElement('td');
cell.setAttribute('colspan', '4');
cell.innerText = "No AJAX requests fired yet.";
cell.innerText = "No AJAX requests yet.";
var row = document.createElement('tr');
row.appendChild(cell);
tbody.appendChild(row);

View File

@ -285,11 +285,10 @@
table.sf-toolbar-ajax-requests {
border-collapse: collapse;
margin: 0 -10px -10px;
}
.sf-toolbar-ajax-requests th, .sf-toolbar-ajax-requests td {
border: 1px solid #ddd;
padding: 0 3px;
border-bottom: 1px solid #ddd;
padding: 0 4px;
}
.sf-toolbar-ajax-requests th {
background-color: #eee;
@ -304,7 +303,7 @@ table.sf-toolbar-ajax-requests {
text-align: right;
}
.sf-ajax-request-error {
color: red;
color: #a33;
}
.sf-ajax-request-loading {
-webkit-animation: sf-blink .5s ease-in-out infinite;