request.html.twig 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. {% block toolbar %}
  2. {% set request_handler %}
  3. <a href="{{ idelink(collector.controller.file, collector.controller.line)|raw }}">{{ abbr(collector.controller.class)|raw }}
  4. ::{{ collector.controller.method }}</a>
  5. {% endset %}
  6. {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %}
  7. {% set request_route = collector.route ? collector.route : 'NONE' %}
  8. {% set icon %}
  9. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'request'}) }}" title="{{ 'Request'|t }}">
  10. <img width="28" height="28" alt="{{ 'Request'|t }}"
  11. src="data:image/png;base64,{{ collector.icon }}">
  12. <span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}"
  13. title="{{ collector.statustext }}">{{ collector.statuscode }}</span>
  14. </a>
  15. {% endset %}
  16. {% set text %}
  17. {% spaceless %}
  18. <div class="sf-toolbar-info-piece">
  19. <b>{{ 'Status'|t }}</b>
  20. <span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}">{{ collector.statuscode }}</span> {{ collector.statustext }}
  21. </div>
  22. <div class="sf-toolbar-info-piece">
  23. <b>{{ 'Controller'|t }}</b>
  24. {{ request_handler }}
  25. </div>
  26. <div class="sf-toolbar-info-piece">
  27. <b>{{ 'Route name'|t }}</b>
  28. <span>{{ request_route }}</span>
  29. </div>
  30. {% endspaceless %}
  31. {% endset %}
  32. <div class="sf-toolbar-block">
  33. <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
  34. <div class="sf-toolbar-info">{{ text|default('') }}</div>
  35. </div>
  36. {% endblock %}
  37. {% block panel %}
  38. <script id="request" type="text/template">
  39. <h2 class="panel__title">{{ 'Request'|t }}</h2>
  40. <% if (!_.isEmpty(data.request_query)) { %>
  41. <div class="panel__container">
  42. <h3>GET parameters</h3>
  43. <table class="table--duo">
  44. <thead>
  45. <th>{{ 'Name'|t }}</th>
  46. <th>{{ 'Value'|t }}</th>
  47. </thead>
  48. <tbody>
  49. <% _.each( data.request_query, function( item, key ){ %>
  50. <tr>
  51. <td><%- key %></td>
  52. <td><%- item %></td>
  53. </tr>
  54. <% }); %>
  55. </tbody>
  56. </table>
  57. </div>
  58. <% } %>
  59. <% if (!_.isEmpty(data.request_request)) { %>
  60. <div class="panel__container">
  61. <h3>POST parameters</h3>
  62. <table class="table--duo">
  63. <thead>
  64. <th>{{ 'Name'|t }}</th>
  65. <th>{{ 'Value'|t }}</th>
  66. </thead>
  67. <tbody>
  68. <% _.each( data.request_request, function( item, key ){ %>
  69. <tr>
  70. <td><%- key %></td>
  71. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  72. </tr>
  73. <% }); %>
  74. </tbody>
  75. </table>
  76. </div>
  77. <% } %>
  78. <div class="panel__container">
  79. <h3>Request attributes</h3>
  80. <table class="table--duo">
  81. <thead>
  82. <th>{{ 'Name'|t }}</th>
  83. <th>{{ 'Value'|t }}</th>
  84. </thead>
  85. <tbody>
  86. <% _.each( data.request_attributes, function( item, key ){ %>
  87. <tr>
  88. <td><%- key %></td>
  89. <% if(key == '_controller') { %>
  90. <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
  91. <% } else if(key == '_form') { %>
  92. <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
  93. <% } else { %>
  94. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  95. <% } %>
  96. </tr>
  97. <% }); %>
  98. </tbody>
  99. </table>
  100. </div>
  101. <% if (!_.isEmpty(data.request_cookies)) { %>
  102. <div class="panel__container">
  103. <h3>Cookies</h3>
  104. <table class="table--duo">
  105. <thead>
  106. <th>{{ 'Name'|t }}</th>
  107. <th>{{ 'Value'|t }}</th>
  108. </thead>
  109. <tbody>
  110. <% _.each( data.request_cookies, function( item, key ){ %>
  111. <tr>
  112. <td><%- key %></td>
  113. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  114. </tr>
  115. <% }); %>
  116. </tbody>
  117. </table>
  118. </div>
  119. <% } %>
  120. <div class="panel__container">
  121. <h3>Request headers</h3>
  122. <table class="table--duo">
  123. <thead>
  124. <th>{{ 'Name'|t }}</th>
  125. <th>{{ 'Value'|t }}</th>
  126. </thead>
  127. <tbody>
  128. <% _.each( data.request_headers, function( item, key ){ %>
  129. <tr>
  130. <td><%- key %></td>
  131. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  132. </tr>
  133. <% }); %>
  134. </tbody>
  135. </table>
  136. </div>
  137. <% if (!_.isEmpty(data.content)) { %>
  138. <div class="panel__container">
  139. <h3>Raw content</h3>
  140. <div class="h--word-broken"><%- data.content %></div>
  141. </div>
  142. <% } %>
  143. <% if (!_.isEmpty(data.access_check)) { %>
  144. <div class="panel__container">
  145. <h3>Access check</h3>
  146. <table class="table--duo">
  147. <thead>
  148. <th>{{ 'Path'|t }}</th>
  149. <th>{{ 'Service'|t }}</th>
  150. </thead>
  151. <tbody>
  152. <% _.each(data.access_check, function(items, key){ %>
  153. <tr>
  154. <td><%- key %></td>
  155. <td>
  156. <% _.each(items, function(item){ %>
  157. <%- item.service_id %>
  158. <% }); %>
  159. </td>
  160. </tr>
  161. <% }); %>
  162. </tbody>
  163. </table>
  164. </div>
  165. <% } %>
  166. <div class="panel__container">
  167. <h3>Server Parameters</h3>
  168. <table class="table--duo">
  169. <thead>
  170. <th>{{ 'Name'|t }}</th>
  171. <th>{{ 'Value'|t }}</th>
  172. </thead>
  173. <tbody>
  174. <% _.each( data.request_server, function( item, key ){ %>
  175. <tr>
  176. <td><%- key %></td>
  177. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  178. </tr>
  179. <% }); %>
  180. </tbody>
  181. </table>
  182. </div>
  183. <div class="panel__container">
  184. <h3>Response headers</h3>
  185. <table class="table--duo">
  186. <thead>
  187. <th>{{ 'Name'|t }}</th>
  188. <th>{{ 'Value'|t }}</th>
  189. </thead>
  190. <tbody>
  191. <% _.each( data.response_headers, function( item, key ){ %>
  192. <tr>
  193. <td><%- key %></td>
  194. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  195. </tr>
  196. <% }); %>
  197. </tbody>
  198. </table>
  199. </div>
  200. </script>
  201. {% endblock %}