You are here

cache.html.twig in Devel 4.x

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

    {% for bin, cids in collector.getCacheHits %}
        <div class="sf-toolbar-info-piece">
            <b>{{ bin }}</b>
            <span>{{ cids }}</span>
        </div>
    {% endfor %}
    {% 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="cache" type="text/template">
        <h2 class="panel__title">{{ 'Cache'|t }}</h2>
        <% if( data.cache.length != 0){ %>
        <% _.each( data.cache, function( item, key ){ %>
        <div class="panel__container">

            <ul class="list--inline">
                <li><b>Bin</b> <%= key %></li>
            </ul>

            <table class="table--trio">
                <thead>
                <tr>
                    <th>{{ 'ID'|t }}</th>
                    <th>{{ 'hit'|t }}</th>
                    <th>{{ 'miss'|t }}</th>
                </tr>
                </thead>
                <tbody>
                <% _.each( item, function( value, key ){ %>
                <tr>
                    <td><%= key %></td>
                    <td><%= value['bin_cids_hit'] %></td>
                    <td><%= value['bin_cids_miss'] %></td>
                </tr>
                <% }); %>
                </tbody>
            </table>
        </div>
        <% }); %>
        <% } else { %>
        <div class="panel__container">
            <p>{{ 'No results'|t }}</p>
        </div>
        <% } %>
    </script>
{% endblock %}

File

webprofiler/templates/Collector/cache.html.twig
View source
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'cache'}) }}" title="{{ 'Cache'|t }}">
  4. <img width="20" height="28" alt="{{ 'Cache'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}"/>
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getCacheHitsCount }}
  7. / {{ collector.getCacheMissesCount }}</span>
  8. </a>
  9. {% endset %}
  10. {% set text %}
  11. {% for bin, cids in collector.getCacheHits %}
  12. <div class="sf-toolbar-info-piece">
  13. <b>{{ bin }}</b>
  14. <span>{{ cids }}</span>
  15. </div>
  16. {% endfor %}
  17. {% endset %}
  18. <div class="sf-toolbar-block">
  19. <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
  20. <div class="sf-toolbar-info">{{ text|default('') }}</div>
  21. </div>
  22. {% endblock %}
  23. {% block panel %}
  24. <script id="cache" type="text/template">
  25. <h2 class="panel__title">{{ 'Cache'|t }}</h2>
  26. <% if( data.cache.length != 0){ %>
  27. <% _.each( data.cache, function( item, key ){ %>
  28. <div class="panel__container">
  29. <ul class="list--inline">
  30. <li><b>Bin</b> <%= key %></li>
  31. </ul>
  32. <table class="table--trio">
  33. <thead>
  34. <tr>
  35. <th>{{ 'ID'|t }}</th>
  36. <th>{{ 'hit'|t }}</th>
  37. <th>{{ 'miss'|t }}</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <% _.each( item, function( value, key ){ %>
  42. <tr>
  43. <td><%= key %></td>
  44. <td><%= value['bin_cids_hit'] %></td>
  45. <td><%= value['bin_cids_miss'] %></td>
  46. </tr>
  47. <% }); %>
  48. </tbody>
  49. </table>
  50. </div>
  51. <% }); %>
  52. <% } else { %>
  53. <div class="panel__container">
  54. <p>{{ 'No results'|t }}</p>
  55. </div>
  56. <% } %>
  57. </script>
  58. {% endblock %}