You are here

http.html.twig in Devel 8.3

{% block toolbar %}
    {% set icon %}
    <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'http'}) }}" title="{{ 'Http'|t }}">
        <img width="20" height="28" alt="{{ 'Http'|t }}"
             src="data:image/png;base64,{{ collector.icon }}"/>
        <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.completedRequestsCount }}</span>
    </a>
    {% endset %}
    {% set text %}
    <div class="sf-toolbar-info-piece">
        <b>{{ 'Completed'|t }}</b>
        <span>{{ collector.completedRequestsCount }}</span>
    </div>
    <div class="sf-toolbar-info-piece">
      <b>{{ 'Failed'|t }}</b>
      <span>{{ collector.failedRequestsCount }}</span>
    </div>
    {% endset %}

    <div class="sf-toolbar-block">
        <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
        <div class="sf-toolbar-info">{{ text|default('') }}</div>
    </div>
{% endblock %}

{% block panel %}
    <script id="http" type="text/template">
        <h2 class="panel__title">{{ 'Http'|t }}</h2>

        <% if( data.completed.length != 0 || data.failed.length != 0){ %>
        <% _.each( data.completed, function( item ) { %>
        <div class="panel__container">
            <div class="panel__expand-header">
                <ul class="list--inline">
                    <li>
                        <b>{{ 'Host'|t }}</b>: <%- item.request.uri.host %>
                    </li>
                    <li>
                        <b>{{ 'Path'|t }}</b>: <%- item.request.uri.path %>
                    </li>
                    <li>
                        <b>{{ 'Status'|t }}</b>: <%- item.response.status %> <%- item.response.phrase %>
                    </li>
                </ul>
                <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
            </div>

            <div class="panel__expand-content">
                <table class="table--duo">
                    <% _.each( item.request, function( message, key ) { %>

                    <% if(key == 'stats') { key = 'stats (time in milliseconds and data in bytes)' } %>

                    <tr>
                        <th><%- key %></th>
                        <td><%= Drupal.webprofiler.helpers.frm(message) %></td>
                    </tr>
                    <% }); %>
                </table>
                <table class="table--duo">
                    <% _.each( item.response, function( header, key ) { %>
                    <tr>
                        <th><%- key %></th>
                        <td><%= Drupal.webprofiler.helpers.frm(header) %></td>
                    </tr>
                    <% }); %>
                </table>
            </div>
        </div>
        <% }); %>
        <% } else { %>
        <div class="panel__container">
            <p>{{ 'No external http calls'|t }}</p>
        </div>
        <% } %>
    </script>
{% endblock %}

File

webprofiler/templates/Collector/http.html.twig
View source
  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 %}