mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-08 18:49:26 +03:00
Merge pull request #345 from AlexeyKupershtokh/web-profiler
Symfony web profiler integration
This commit is contained in:
commit
ea2201762d
@ -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));
|
||||
|
||||
|
@ -311,7 +311,7 @@
|
||||
<h4>Request URL</h4>
|
||||
<pre class="url"></pre>
|
||||
|
||||
<h4>Response Headers <small>[<a href="" class="to-expand">Expand</a>]</small></h4>
|
||||
<h4>Response Headers <small>[<a href="" class="to-expand">Expand</a>]</small> <small class="profiler">[<a href="" class="profiler-link" target="_blank">Profiler</a>]</small></h4>
|
||||
<pre class="headers to-expand"></pre>
|
||||
|
||||
<h4>Response Body <small>[<a href="" class="to-raw">Raw</a>]</small></h4>
|
||||
|
Loading…
x
Reference in New Issue
Block a user