ea7ad04963d7bc346d61140552502844eeade952
[yaffs-website] / web / modules / contrib / devel / webprofiler / templates / Collector / http.html.twig
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
20     <div class="sf-toolbar-block">
21         <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
22         <div class="sf-toolbar-info">{{ text|default('') }}</div>
23     </div>
24 {% endblock %}
25
26 {% block panel %}
27     <script id="http" type="text/template">
28         <h2 class="panel__title">{{ 'Http'|t }}</h2>
29
30         <% if( data.completed.length != 0 || data.failed.length != 0){ %>
31         <% _.each( data.completed, function( item ) { %>
32         <div class="panel__container">
33             <div class="panel__expand-header">
34                 <ul class="list--inline">
35                     <li>
36                         <b>{{ 'Host'|t }}</b>: <%- item.request.uri.host %>
37                     </li>
38                     <li>
39                         <b>{{ 'Path'|t }}</b>: <%- item.request.uri.path %>
40                     </li>
41                     <li>
42                         <b>{{ 'Status'|t }}</b>: <%- item.response.status %> <%- item.response.phrase %>
43                     </li>
44                 </ul>
45                 <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
46             </div>
47
48             <div class="panel__expand-content">
49                 <table class="table--duo">
50                     <% _.each( item.request, function( message, key ) { %>
51
52                     <% if(key == 'stats') { key = 'stats (time in milliseconds and data in bytes)' } %>
53
54                     <tr>
55                         <th><%- key %></th>
56                         <td><%= Drupal.webprofiler.helpers.frm(message) %></td>
57                     </tr>
58                     <% }); %>
59                 </table>
60                 <table class="table--duo">
61                     <% _.each( item.response, function( header, key ) { %>
62                     <tr>
63                         <th><%- key %></th>
64                         <td><%= Drupal.webprofiler.helpers.frm(header) %></td>
65                     </tr>
66                     <% }); %>
67                 </table>
68             </div>
69         </div>
70         <% }); %>
71         <% } else { %>
72         <div class="panel__container">
73             <p>{{ 'No external http calls'|t }}</p>
74         </div>
75         <% } %>
76     </script>
77 {% endblock %}