Merge pull request #345 from AlexeyKupershtokh/web-profiler

Symfony web profiler integration
This commit is contained in:
William Durand 2014-06-25 10:56:43 +02:00
commit ea2201762d
2 changed files with 13 additions and 1 deletions

View File

@ -225,6 +225,17 @@
container.text(method + ' ' + url);
};
var displayProfilerUrl = function(xhr, link, container) {
var profilerUrl = xhr.getResponseHeader('X-Debug-Token-Link');
if (profilerUrl) {
link.attr('href', profilerUrl);
container.show();
} else {
link.attr('href', '');
container.hide();
}
}
var displayResponseData = function(xhr, container) {
var data = xhr.responseText;
@ -245,6 +256,7 @@
var displayResponse = function(xhr, method, url, result_container) {
displayFinalUrl(xhr, method, url, $('.url', result_container));
displayProfilerUrl(xhr, $('.profiler-link', result_container), $('.profiler', result_container));
displayResponseData(xhr, $('.response', result_container));
displayResponseHeaders(xhr, $('.headers', result_container));

View File

@ -311,7 +311,7 @@
<h4>Request URL</h4>
<pre class="url"></pre>
<h4>Response Headers&nbsp;<small>[<a href="" class="to-expand">Expand</a>]</small></h4>
<h4>Response Headers&nbsp;<small>[<a href="" class="to-expand">Expand</a>]</small>&nbsp;<small class="profiler">[<a href="" class="profiler-link" target="_blank">Profiler</a>]</small></h4>
<pre class="headers to-expand"></pre>
<h4>Response Body&nbsp;<small>[<a href="" class="to-raw">Raw</a>]</small></h4>