mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Show web profiler link in sandbox
This commit is contained in:
parent
855f95afd1
commit
11f163d589
@ -154,6 +154,17 @@
|
|||||||
container.text(method + ' ' + url);
|
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 displayResponseData = function(xhr, container) {
|
||||||
var data = xhr.responseText;
|
var data = xhr.responseText;
|
||||||
|
|
||||||
@ -174,6 +185,7 @@
|
|||||||
|
|
||||||
var displayResponse = function(xhr, method, url, result_container) {
|
var displayResponse = function(xhr, method, url, result_container) {
|
||||||
displayFinalUrl(xhr, method, url, $('.url', result_container));
|
displayFinalUrl(xhr, method, url, $('.url', result_container));
|
||||||
|
displayProfilerUrl(xhr, $('.profiler-link', result_container), $('.profiler', result_container));
|
||||||
displayResponseData(xhr, $('.response', result_container));
|
displayResponseData(xhr, $('.response', result_container));
|
||||||
displayResponseHeaders(xhr, $('.headers', result_container));
|
displayResponseHeaders(xhr, $('.headers', result_container));
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
<h4>Request URL</h4>
|
<h4>Request URL</h4>
|
||||||
<pre class="url"></pre>
|
<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>
|
<pre class="headers to-expand"></pre>
|
||||||
|
|
||||||
<h4>Response Body <small>[<a href="" class="to-raw">Raw</a>]</small></h4>
|
<h4>Response Body <small>[<a href="" class="to-raw">Raw</a>]</small></h4>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user