http.html.twig 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'http'}) }}" title="{{ 'Http'|t }}">
  4. <img width="20" height="28" alt="{{ 'Http'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}"/>
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.completedRequestsCount }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. <div class="sf-toolbar-info-piece">
  11. <b>{{ 'Completed'|t }}</b>
  12. <span>{{ collector.completedRequestsCount }}</span>
  13. </div>
  14. <div class="sf-toolbar-info-piece">
  15. <b>{{ 'Failed'|t }}</b>
  16. <span>{{ collector.failedRequestsCount }}</span>
  17. </div>
  18. {% endset %}
  19. <div class="sf-toolbar-block">
  20. <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
  21. <div class="sf-toolbar-info">{{ text|default('') }}</div>
  22. </div>
  23. {% endblock %}
  24. {% block panel %}
  25. <script id="http" type="text/template">
  26. <h2 class="panel__title">{{ 'Http'|t }}</h2>
  27. <% if( data.completed.length != 0 || data.failed.length != 0){ %>
  28. <% _.each( data.completed, function( item ) { %>
  29. <div class="panel__container">
  30. <div class="panel__expand-header">
  31. <ul class="list--inline">
  32. <li>
  33. <b>{{ 'Host'|t }}</b>: <%- item.request.uri.host %>
  34. </li>
  35. <li>
  36. <b>{{ 'Path'|t }}</b>: <%- item.request.uri.path %>
  37. </li>
  38. <li>
  39. <b>{{ 'Status'|t }}</b>: <%- item.response.status %> <%- item.response.phrase %>
  40. </li>
  41. </ul>
  42. <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
  43. </div>
  44. <div class="panel__expand-content">
  45. <table class="table--duo">
  46. <% _.each( item.request, function( message, key ) { %>
  47. <% if(key == 'stats') { key = 'stats (time in milliseconds and data in bytes)' } %>
  48. <tr>
  49. <th><%- key %></th>
  50. <td><%= Drupal.webprofiler.helpers.frm(message) %></td>
  51. </tr>
  52. <% }); %>
  53. </table>
  54. <table class="table--duo">
  55. <% _.each( item.response, function( header, key ) { %>
  56. <tr>
  57. <th><%- key %></th>
  58. <td><%= Drupal.webprofiler.helpers.frm(header) %></td>
  59. </tr>
  60. <% }); %>
  61. </table>
  62. </div>
  63. </div>
  64. <% }); %>
  65. <% } else { %>
  66. <div class="panel__container">
  67. <p>{{ 'No external http calls'|t }}</p>
  68. </div>
  69. <% } %>
  70. </script>
  71. {% endblock %}