Show web profiler link in sandbox

This commit is contained in:
Alexey Kupershtokh 2014-03-11 07:07:35 +07:00
parent 855f95afd1
commit 11f163d589
2 changed files with 13 additions and 1 deletions

View File

@ -154,6 +154,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;
@ -174,6 +185,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

@ -285,7 +285,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>