request.html.twig 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. <table class="table--duo">
  43. <thead>
  44. <th>{{ 'GET Parameters'|t }}</th>
  45. <th>{{ 'Value'|t }}</th>
  46. </thead>
  47. <tbody>
  48. <% _.each( data.request_query, function( item, key ){ %>
  49. <tr>
  50. <td><%- key %></td>
  51. <td><%- item %></td>
  52. </tr>
  53. <% }); %>
  54. </tbody>
  55. </table>
  56. </div>
  57. <% } %>
  58. <% if (!_.isEmpty(data.request_request)) { %>
  59. <div class="panel__container">
  60. <table class="table--duo">
  61. <thead>
  62. <th>{{ 'POST Parameters'|t }}</th>
  63. <th>{{ 'Value'|t }}</th>
  64. </thead>
  65. <tbody>
  66. <% _.each( data.request_request, function( item, key ){ %>
  67. <tr>
  68. <td><%- key %></td>
  69. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  70. </tr>
  71. <% }); %>
  72. </tbody>
  73. </table>
  74. </div>
  75. <% } %>
  76. <div class="panel__container">
  77. <table class="table--duo">
  78. <thead>
  79. <th>{{ 'Attributes'|t }}</th>
  80. <th>{{ 'Value'|t }}</th>
  81. </thead>
  82. <tbody>
  83. <% _.each( data.request_attributes, function( item, key ){ %>
  84. <tr>
  85. <td><%- key %></td>
  86. <% if(key == '_controller') { %>
  87. <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
  88. <% } else { %>
  89. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  90. <% } %>
  91. </tr>
  92. <% }); %>
  93. </tbody>
  94. </table>
  95. </div>
  96. <% if (!_.isEmpty(data.request_cookies)) { %>
  97. <div class="panel__container">
  98. <table class="table--duo">
  99. <thead>
  100. <th>{{ 'Cookies'|t }}</th>
  101. <th>{{ 'Value'|t }}</th>
  102. </thead>
  103. <tbody>
  104. <% _.each( data.request_cookies, function( item, key ){ %>
  105. <tr>
  106. <td><%- key %></td>
  107. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  108. </tr>
  109. <% }); %>
  110. </tbody>
  111. </table>
  112. </div>
  113. <% } %>
  114. <div class="panel__container">
  115. <table class="table--duo">
  116. <thead>
  117. <th>{{ 'Request headers'|t }}</th>
  118. <th>{{ 'Value'|t }}</th>
  119. </thead>
  120. <tbody>
  121. <% _.each( data.request_headers, function( item, key ){ %>
  122. <tr>
  123. <td><%- key %></td>
  124. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  125. </tr>
  126. <% }); %>
  127. </tbody>
  128. </table>
  129. </div>
  130. <% if (!_.isEmpty(data.content)) { %>
  131. <div class="panel__container">
  132. <div class="h--word-broken"><%- data.content %></div>
  133. </div>
  134. <% } %>
  135. <% if (!_.isEmpty(data.access_check)) { %>
  136. <div class="panel__container">
  137. <table class="table--duo">
  138. <thead>
  139. <th>{{ 'Path'|t }}</th>
  140. <th>{{ 'Access check'|t }}</th>
  141. </thead>
  142. <tbody>
  143. <% _.each(data.access_check, function(items, key){ %>
  144. <tr>
  145. <td><%- key %></td>
  146. <td>
  147. <% _.each(items, function(item){ %>
  148. <%- item.service_id %>
  149. <% }); %>
  150. </td>
  151. </tr>
  152. <% }); %>
  153. </tbody>
  154. </table>
  155. </div>
  156. <% } %>
  157. <div class="panel__container">
  158. <table class="table--duo">
  159. <thead>
  160. <th>{{ 'Server Parameters'|t }}</th>
  161. <th>{{ 'Value'|t }}</th>
  162. </thead>
  163. <tbody>
  164. <% _.each( data.request_server, function( item, key ){ %>
  165. <tr>
  166. <td><%- key %></td>
  167. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  168. </tr>
  169. <% }); %>
  170. </tbody>
  171. </table>
  172. </div>
  173. <div class="panel__container">
  174. <table class="table--duo">
  175. <thead>
  176. <th>{{ 'Response headers'|t }}</th>
  177. <th>{{ 'Value'|t }}</th>
  178. </thead>
  179. <tbody>
  180. <% _.each( data.response_headers, function( item, key ){ %>
  181. <tr>
  182. <td><%- key %></td>
  183. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  184. </tr>
  185. <% }); %>
  186. </tbody>
  187. </table>
  188. </div>
  189. </script>
  190. {% endblock %}